### Question:
AlleleCountPositionToAlleleCountHBaseProto { public byte[] variantToBytes(AlleleCountPosition position) { return toBytes(toAlleleMap(position.getAlternate())); } AlleleCountPositionToAlleleCountHBaseProto(); byte[] toBytes(MessageLite msg); byte[] variantToBytes(AlleleCountPosition position); byte[] referenceToBytes(AlleleCountPosition position); boolean hasVariantData(AlleleCountPosition position); boolean hasReferenceData(AlleleCountPosition position); boolean hasAnyData(Map<Integer, List<Integer>> map, boolean ignoreHomRef); ReferenceCountHBaseProto.Builder convertToBuilder(AlleleCountPosition position); ReferenceCountHBaseProto convert(AlleleCountPosition position); SampleList toSampleList(List<Integer> samples);  }### Answer:
@Test public void roundtripAlternate() throws Exception { AlleleCountPosition position = new AlleleCountPosition(); List<Integer> value = Arrays.asList(3, 2, 1); position.getReference().put(1, value); position.getAlternate().put(2, value); position.getAltMap().computeIfAbsent("a", k -> new HashMap<>()).put(3, value); byte[] bytes = to.variantToBytes(position); equalAlternate(position, from.variantFromBytes(bytes)); byte[] added = Bytes.add(bytes, bytes); List<Integer> addedValues = new ArrayList<>(value); addedValues.addAll(value); AlleleCountPosition addedPos = from.variantFromBytes(added); assertTrue(addedPos.getReference().isEmpty()); assertTrue(addedPos.getAltMap().isEmpty()); assertEquals(addedValues, addedPos.getAlternate().get(2)); }