PrimaryKey implements Byteable, Comparable<PrimaryKey> { @Override public int size() { return SIZE; } private  PrimaryKey(long data); private  PrimaryKey(long data, @Nullable ByteBuffer bytes); static PrimaryKey fromByteBuffer(ByteBuffer bytes); static PrimaryKey wrap(long data); @Override int compareTo(PrimaryKey other); @Override void copyTo(ByteSink sink); @Override boolean equals(Object obj); @Override ByteBuffer getBytes(); @Override int hashCode(); long longValue(); @Override int size(); @Override String toString(); static final int SIZE; }
@Test public void testSize() { PrimaryKey key = TestData.getPrimaryKey(); Assert.assertEquals(PrimaryKey.SIZE, key.size()); Assert.assertEquals(PrimaryKey.SIZE, key.getBytes().capacity()); }