IntegerSerializer extends AbstractSerializer<Integer> { @Override public Integer fromByteBuffer(ByteBuffer byteBuffer) { if (byteBuffer == null) { return null; } int in = byteBuffer.getInt(); return in; }  static IntegerSerializer get(); @Override ByteBuffer toByteBuffer(Integer obj); @Override Integer fromByteBuffer(ByteBuffer byteBuffer); @Override Integer fromBytes(byte[] bytes);  }
@Test public void testFromCassandra() { assertEquals(new Integer(1), ext.fromByteBuffer(ByteBufferUtil.bytes(1))); assertEquals(new Integer(-1), ext.fromByteBuffer(ByteBufferUtil.bytes(-1))); assertEquals(new Integer(0), ext.fromByteBuffer(ByteBufferUtil.bytes(0))); assertEquals(new Integer(Integer.MAX_VALUE), ext.fromByteBuffer(ByteBufferUtil.bytes(Integer.MAX_VALUE))); assertEquals(new Integer(Integer.MIN_VALUE), ext.fromByteBuffer(ByteBufferUtil.bytes(Integer.MIN_VALUE))); }