### Question:
MultiAlleleProteinVariant extends ProteinVariant { @Override public String toHGVSString(AminoAcidCode code) { ArrayList<String> parts = new ArrayList<>(); parts.add(getSequenceNamePrefix()); parts.add(":p."); boolean first = true; for (ProteinChangeAllele allele : alleles) { if (first) first = false; else parts.add(";"); parts.add(allele.toHGVSString(code)); } return Joiner.on("").join(parts); } MultiAlleleProteinVariant(String proteinID, Collection<ProteinChangeAllele> alleles); static MultiAlleleProteinVariant build(String proteinID, ProteinChangeAllele... alleles); ImmutableList<ProteinChangeAllele> getAlleles(); @Override String toHGVSString(AminoAcidCode code); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testToHGVSStringSingleChange() { Assert.assertEquals("PROTEIN:p.[A100G;T301R]", singleAlleleVariant.toHGVSString(AminoAcidCode.ONE_LETTER)); Assert.assertEquals("PROTEIN:p.[Ala100Gly;Thr301Arg]", singleAlleleVariant.toHGVSString(AminoAcidCode.THREE_LETTER)); Assert.assertEquals("PROTEIN:p.[Ala100Gly;Thr301Arg]", singleAlleleVariant.toHGVSString()); }
@Test public void testToHGVSStringMultiChange() { Assert.assertEquals("PROTEIN:p.[A100G;T301R];[R34V;L301K]", multiAlleleVariant.toHGVSString(AminoAcidCode.ONE_LETTER)); Assert.assertEquals("PROTEIN:p.[Ala100Gly;Thr301Arg];[Arg34Val;Leu301Lys]", multiAlleleVariant.toHGVSString(AminoAcidCode.THREE_LETTER)); Assert.assertEquals("PROTEIN:p.[Ala100Gly;Thr301Arg];[Arg34Val;Leu301Lys]", multiAlleleVariant.toHGVSString()); }