LongSerializer extends AbstractSerializer<Long> { @Override public Long fromByteBuffer(ByteBuffer byteBuffer) { if ((byteBuffer == null) || (byteBuffer.remaining() < 8)) { return null; } long l = byteBuffer.getLong(); return l; }  static LongSerializer get(); @Override ByteBuffer toByteBuffer(Long obj); @Override Long fromByteBuffer(ByteBuffer byteBuffer); @Override ComparatorType getComparatorType();  }
@Test public void testFromCassandra() { assertEquals(new Long(1), ext.fromByteBuffer(ByteBufferUtil.bytes(1L))); assertEquals(new Long(0), ext.fromByteBuffer(ByteBufferUtil.bytes(0L))); assertEquals(new Long(-1), ext.fromByteBuffer(ByteBufferUtil.bytes(-1L))); assertEquals(new Long(Long.MIN_VALUE), ext.fromByteBuffer(ByteBufferUtil.bytes(Long.MIN_VALUE))); assertEquals(new Long(Long.MAX_VALUE), ext.fromByteBuffer(ByteBufferUtil.bytes(Long.MAX_VALUE))); }