### Question:
HopRowCoder extends AtomicCoder<HopRow> { @Override public void encode( HopRow value, OutputStream outStream ) throws CoderException, IOException { Object[] row = value.getRow(); ObjectOutputStream out = new ObjectOutputStream( outStream ); if ( row == null ) { out.writeInt( -1 ); return; } else { out.writeInt( row.length ); } for ( int i = 0; i < row.length; i++ ) { Object object = row[ i ]; out.writeBoolean( object == null ); if ( object != null ) { int objectType = getObjectType( object ); out.writeInt( objectType ); write( out, objectType, object ); } } out.flush(); }  @Override void encode( HopRow value, OutputStream outStream ); @Override HopRow decode( InputStream inStream ); @Override void verifyDeterministic();  }### Answer:
@Test public void testEncode() throws IOException { HopRow row1 = new HopRow(new Object[] { "AAA", "BBB", Long.valueOf( 100 ), Double.valueOf(1.234), new Date( 876876868 ) } ); hopRowCoder.encode( row1, outputStream ); outputStream.flush(); outputStream.close(); byte[] bytes = outputStream.toByteArray(); ByteArrayInputStream inputStream = new ByteArrayInputStream( bytes ); HopRow row1d = hopRowCoder.decode( inputStream ); assertEquals( row1, row1d ); }