@Test
public void testWriteLong() throws Exception {

    checkWrite(new byte[]{0}, 0L);
    checkWrite(new byte[]{1}, null);
    checkWrite(new byte[]{2}, 1L);
    checkWrite(new byte[]{3}, -1L);
    checkWrite(new byte[]{126}, 63L);
    checkWrite(new byte[]{127}, -63L);
    checkWrite(new byte[]{-128, 1}, 64L);
    checkWrite(new byte[]{-127, 1}, -64L);
    assertEquals(10, Numbers.getSerializedSize(Long.MAX_VALUE));
    assertEquals(10, Numbers.getSerializedSize(Long.MIN_VALUE));
}