### Question:
PerAlleleCollection { public void set(Allele allele, X newValue){ if (allele == null || newValue == null){ throw new IllegalArgumentException("allele or newValue is null"); } if (allele.isReference() && altOnly){ throw new IllegalArgumentException("Collection stores values for alternate alleles only"); } if (allele.isReference()){ this.setRef(allele, newValue); } else { this.setAlt(allele, newValue); } } private  PerAlleleCollection(boolean altOnly); static PerAlleleCollection createPerAltAlleleCollection(); static PerAlleleCollection createPerRefAndAltAlleleCollection(); void set(Allele allele, X newValue); void setRef(Allele refAllele, X newValue); void setAlt(Allele altAllele, X newValue); X get(Allele allele); X getRef(); X getAlt(Allele allele); Set<Allele> getAltAlleles();  }### Answer:
@Test public void testSet() throws Exception { PerAlleleCollection<Integer> alleleCounts = PerAlleleCollection.createPerRefAndAltAlleleCollection(); Allele refA = Allele.create("A", true); Allele altT = Allele.create("T", false); alleleCounts.set(refA, 40); alleleCounts.set(altT, 10); assertEquals((int)alleleCounts.getRef(), 40); assertEquals((int)alleleCounts.getAlt(altT), 10); }