### Question:
VariantStatsCalculator { public static void addFileFilter(String filter, Map<String, Integer> filterCount) { if (StringUtils.isEmpty(filter)) { filter = "."; } int endIndex = 0; do { int startIndex = endIndex; endIndex = filter.indexOf(";", endIndex); if (endIndex < 0) { filterCount.merge(filter.substring(startIndex), 1, Integer::sum); break; } else { filterCount.merge(filter.substring(startIndex, endIndex), 1, Integer::sum); } endIndex++; } while (true); }  static VariantStats calculate(Variant variant, StudyEntry study); static VariantStats calculate(Variant variant, StudyEntry study, Collection<String> sampleNames); static VariantStats calculate(Variant variant, int homRefCount, int hetCount, int homAltCount, int missingCount); static VariantStats calculateHemizygous(Variant variant, int refCount, int altCount, int missingCount); static VariantStats calculate(Variant variant, Map<Genotype, Integer> genotypeCount); static VariantStats calculate(Variant variant, Map<Genotype, Integer> genotypeCount, boolean multiAllelic); static void calculate(Map<Genotype, Integer> genotypeCount, VariantStats variantStats,
                                 String refAllele, String altAllele); static void calculateFilterFreq(VariantStats variantStats, final int numFiles); static void calculateFilterFreq(VariantStats variantStats, final int numFiles, Map<String, Integer> filterCount); static void addFileFilter(String filter, Map<String, Integer> filterCount); static void calculate(Map<Genotype, Integer> genotypeCount, VariantStats variantStats,
                                 String refAllele, String altAllele, boolean multiAllelic); static void calculateStatsForVariantsList(List<Variant> variants, Pedigree ped); static void calculateGenotypeFrequencies(VariantStats variantStats); static Map<Genotype, Integer> removePhaseFromGenotypeCount(Map<Genotype, Integer> genotypeCount); static final String OTHER_ALLELE; }### Answer:
@Test public void testAddFilter() { HashMap<String, Integer> map = new HashMap<>(); VariantStatsCalculator.addFileFilter("PASS", map); assertEquals("PASS", Integer.valueOf(1), map.get("PASS")); VariantStatsCalculator.addFileFilter("PASS", map); assertEquals("PASS", Integer.valueOf(2), map.get("PASS")); VariantStatsCalculator.addFileFilter("PASS;other", map); assertEquals("PASS", Integer.valueOf(3), map.get("PASS")); assertEquals("other", Integer.valueOf(1), map.get("other")); VariantStatsCalculator.addFileFilter("other", map); assertEquals("PASS", Integer.valueOf(3), map.get("PASS")); assertEquals("other", Integer.valueOf(2), map.get("other")); }