@Test
public void roundtripReference() 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.referenceToBytes(position);
    equalReference(position, from.referenceFromBytes(bytes));
    byte[] added = Bytes.add(bytes, bytes);
    List<Integer> addedValues = new ArrayList<>(value);
    addedValues.addAll(value); // double the values
    AlleleCountPosition addedPos = from.referenceFromBytes(added);
    assertEquals(addedValues, addedPos.getReference().get(1));
    assertTrue(addedPos.getAlternate().isEmpty());
    assertEquals(addedValues, addedPos.getAltMap().get("a").get(3));
}