### Question:
ShortAccessor implements PropertyAccessor<Short> { @Override public Short fromBytes(Class targetClass, byte[] data) { if (data == null || data.length != 2) { if (log.isWarnEnabled()) { log.warn("Bytes length not equal to 2"); } return 0x0; } return (short) ((0xff & data[0]) << 8 | (0xff & data[1]) << 0); }  @Override Short fromBytes(Class targetClass, byte[] data); @Override byte[] toBytes(Object object); @Override String toString(Object object); @Override Short fromString(Class targetClass, String s); @Override Short getCopy(Object object); Short getInstance(Class<?> clazz); static Logger log; }### Answer:
@Test public void testFromBytes() { Assert.assertEquals(new Short((short)0), accessor.fromBytes(Short.class, null)); Short d1 = new Short((short)4); byte[] b = accessor.toBytes(d1); Short d2 = accessor.fromBytes(Short.class, b); Assert.assertEquals(d1, d2); }