ResultsWriterUtils { public static List<Gene> getMaxPassedGenes(List<Gene> genes, int maxGenes) { List<Gene> passedGenes = getPassedGenes(genes); if (maxGenes == 0) { logger.debug("Maximum gene limit set to {} - Returning all {} genes which have passed filtering.", maxGenes, passedGenes.size()); return passedGenes; } return getMaxGenes(passedGenes, maxGenes); } private  ResultsWriterUtils(); static String makeOutputFilename(Path vcfPath, String outputPrefix, OutputFormat outputFormat, ModeOfInheritance modeOfInheritance); static List<VariantEffectCount> makeVariantEffectCounters(List<String> sampleNames, List<VariantEvaluation> variantEvaluations); static List<FilterReport> makeFilterReports(Analysis analysis, AnalysisResults analysisResults); static List<Gene> getMaxPassedGenes(List<Gene> genes, int maxGenes);  }
@Test public void testMaxPassedGenesWhereMaxGenesIsZero() { List<Gene> allPassedGenes = new ArrayList<>(); allPassedGenes.add(passedGeneOne); allPassedGenes.add(passedGeneTwo); assertThat(ResultsWriterUtils.getMaxPassedGenes(getGenes(), 0), equalTo(allPassedGenes)); }
@Test public void testMaxPassedGenesWhereMaxGenesIsOne() { List<Gene> onePassed = new ArrayList<>(); onePassed.add(passedGeneOne); assertThat(ResultsWriterUtils.getMaxPassedGenes(getGenes(), 1), equalTo(onePassed)); }
@Test public void testMaxPassedGenesWhereMaxGenesIsGreaterThanInputSize() { List<Gene> allPassedGenes = new ArrayList<>(); allPassedGenes.add(passedGeneOne); allPassedGenes.add(passedGeneTwo); assertThat(ResultsWriterUtils.getMaxPassedGenes(getGenes(), 100), equalTo(allPassedGenes)); }