### Question:
ShortAccessor implements PropertyAccessor<Short> { @Override public byte[] toBytes(Object object) { Short s = null; if (object != null) { if (object.getClass().isAssignableFrom(String.class)) { s = Short.valueOf(object.toString()); } else { s = (Short) object; } return new byte[] { (byte) ((s >> 8) & 0xff), (byte) ((s >> 0) & 0xff), }; } return null; }  @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 testToBytes() { short s = -1; byte[] b = accessor.toBytes(s); short s2 = accessor.fromBytes(Short.class, b); Assert.assertEquals(s, s2); }