### Question:
LongAccessor implements PropertyAccessor<Long> { @Override public final Long fromBytes(Class targetClass, byte[] bytes) { if (bytes == null || bytes.length != 8) { if (log.isWarnEnabled()) { log.warn("Bytes length not equal to 8"); } return null; } return (ByteBuffer.wrap(bytes).getLong()); }  @Override final Long fromBytes(Class targetClass, byte[] bytes); @Override final byte[] toBytes(Object object); @Override final String toString(Object object); @Override Long fromString(Class targetClass, String s); @Override Long getCopy(Object object); Long getInstance(Class<?> clazz);  }### Answer:
@Test public void testFromBytes() { byte[] bytes = new byte[] {}; Assert.assertNull(accessor.fromBytes(LongAccessor.class, bytes)); Long l = 49L; bytes = accessor.toBytes(l); Assert.assertEquals(l, accessor.fromBytes(LongAccessor.class, bytes)); l = 12l; bytes = accessor.toBytes(l); Assert.assertEquals(l, (Long) accessor.fromBytes(LongAccessor.class, bytes)); }