PhenoGridMatch { @JsonIgnore public Set<String> getQueryTermIds() { Set<String> queryTermIds = new TreeSet<>(); for (PhenotypeMatch phenotypeMatch : matches) { PhenotypeTerm queryPhenotype = phenotypeMatch.getQueryPhenotype(); queryTermIds.add(queryPhenotype.getId()); } return queryTermIds; } PhenoGridMatch(String id, String label, String type, List<PhenotypeMatch> phenotypeMatches, PhenoGridMatchScore score, PhenoGridMatchTaxon taxon); String getId(); String getLabel(); String getType(); List<PhenotypeMatch> getMatches(); PhenoGridMatchScore getScore(); PhenoGridMatchTaxon getTaxon(); @JsonIgnore Set<String> getQueryTermIds(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testGetQueryTermIds() { Set queryTermIds = new LinkedHashSet(); for (PhenotypeMatch phenotypeMatch : phenotypeMatches) { PhenotypeTerm queryPhenotype = phenotypeMatch.getQueryPhenotype(); queryTermIds.add(queryPhenotype.getId()); } assertThat(instance.getQueryTermIds(), equalTo(queryTermIds)); }