AnalysisResults { @JsonIgnore public List<GeneScore> getGeneScoresForMode(ModeOfInheritance modeOfInheritance) { return sortedGeneScoresWithContributingVariantsForMode(modeOfInheritance) .collect(toList()); } AnalysisResults(Builder builder); String getProbandSampleName(); List<String> getSampleNames(); List<Gene> getGenes(); List<VariantEvaluation> getVariantEvaluations(); @JsonIgnore List<GeneScore> getGeneScores(); @JsonIgnore List<GeneScore> getGeneScoresForMode(ModeOfInheritance modeOfInheritance); @JsonIgnore List<VariantEvaluation> getContributingVariants(); @JsonIgnore List<VariantEvaluation> getContributingVariantsForMode(ModeOfInheritance modeOfInheritance); @JsonIgnore List<VariantEvaluation> getUnAnnotatedVariantEvaluations(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); static Builder builder();  }
@Test public void testGetGeneScoresForMode() { Gene fgfr2Gene = TestFactory.newGeneFGFR2(); VariantEvaluation top = VariantEvaluation.builder(10, 23456, "G", "T").build(); GeneScore firstAD = GeneScore.builder() .geneIdentifier(fgfr2Gene.getGeneIdentifier()) .modeOfInheritance(ModeOfInheritance.AUTOSOMAL_DOMINANT) .combinedScore(1f) .contributingVariants(ImmutableList.of(top)) .build(); VariantEvaluation bottom = VariantEvaluation.builder(10, 23456, "A", "T").build(); GeneScore thirdAR = GeneScore.builder() .geneIdentifier(fgfr2Gene.getGeneIdentifier()) .modeOfInheritance(ModeOfInheritance.AUTOSOMAL_RECESSIVE) .combinedScore(0.50f) .contributingVariants(ImmutableList.of(bottom)) .build(); fgfr2Gene.addGeneScore(firstAD); fgfr2Gene.addGeneScore(thirdAR); Gene rbm8aGene = TestFactory.newGeneRBM8A(); VariantEvaluation middle = VariantEvaluation.builder(7, 456889, "C", "A").build(); GeneScore secondAD = GeneScore.builder() .geneIdentifier(rbm8aGene.getGeneIdentifier()) .modeOfInheritance(ModeOfInheritance.AUTOSOMAL_DOMINANT) .combinedScore(0.75f) .contributingVariants(ImmutableList.of(middle)) .build(); rbm8aGene.addGeneScore(secondAD); Gene shhGene = TestFactory.newGeneSHH(); List<Gene> genes = ImmutableList.of(fgfr2Gene, rbm8aGene, shhGene); AnalysisResults instance = AnalysisResults.builder() .genes(genes) .build(); assertThat(instance.getGeneScoresForMode(ModeOfInheritance.AUTOSOMAL_DOMINANT), equalTo(ImmutableList.of(firstAD, secondAD))); assertThat(instance.getGeneScoresForMode(ModeOfInheritance.AUTOSOMAL_RECESSIVE), equalTo(ImmutableList.of(thirdAR))); }