@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); // double the values
    AlleleCountPosition addedPos = from.variantFromBytes(added);
    assertTrue(addedPos.getReference().isEmpty());
    assertTrue(addedPos.getAltMap().isEmpty());
    assertEquals(addedValues, addedPos.getAlternate().get(2));
}