/** * Adds and returns filtered match to sequence * * @param match Match to add * @return Match to sequence * @throws IllegalArgumentException if match is null */ public <T extends Match> T addMatch(T match) throws IllegalArgumentException { if (match == null) { throw new IllegalArgumentException("'Match' must not be null"); } if (match.getProtein() != null) { match.getProtein().removeMatch(match); } match.setProtein(this); matches.add(match); return match; }