### Question:
ShortSerializer extends AbstractElementSerializer<Short> { private ShortSerializer() { super( ShortComparator.INSTANCE ); } private  ShortSerializer(); byte[] serialize( Short element ); static byte[] serialize( short value ); static byte[] serialize( byte[] buffer, int start, short value ); static Short deserialize( byte[] in ); static Short deserialize( byte[] in, int start ); Short fromBytes( byte[] in ); Short fromBytes( byte[] in, int start ); Short deserialize( ByteBuffer buffer ); Short deserialize( BufferHandler bufferHandler ); final static ShortSerializer INSTANCE; }### Answer:
@Test public void testShortSerializer() throws IOException { short value = 0x0000; byte[] result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = 0x0001; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0x01, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = 0x00FF; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0xFF, result[1] ); assertEquals( ( byte ) 0x00, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = 0x0100; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x01, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = 0x7FFF; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0xFF, result[1] ); assertEquals( ( byte ) 0x7F, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = ( short ) 0x8000; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0x00, result[1] ); assertEquals( ( byte ) 0x80, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); value = ( short ) 0xFFFF; result = ShortSerializer.serialize( value ); assertEquals( ( byte ) 0xFF, result[1] ); assertEquals( ( byte ) 0xFF, result[0] ); assertEquals( value, ShortSerializer.INSTANCE.deserialize( new BufferHandler( result ) ).shortValue() ); }