### Question:
RecordMessageEncoder implements ResponseMessageEncoder<RecordMessage> { @Override public void encode( Neo4jPack.Packer packer, RecordMessage message ) throws IOException { AnyValue[] fields = message.fields(); packer.packStructHeader( 1, message.signature() ); packer.packListHeader( fields.length ); for ( AnyValue field : fields ) { packer.pack( field ); } }  @Override void encode( Neo4jPack.Packer packer, RecordMessage message );  }### Answer:
@Test void shouldEncodeRecordMessage() throws Throwable { Neo4jPack.Packer packer = mock( Neo4jPack.Packer.class ); RecordMessageEncoder encoder = new RecordMessageEncoder(); QueryResult.Record value = mock( QueryResult.Record.class ); when( value.fields() ).thenReturn( new AnyValue[0] ); encoder.encode( packer, new RecordMessage( value ) ); verify( packer ).packStructHeader( anyInt(), eq( RecordMessage.SIGNATURE ) ); verify( packer ).packListHeader( 0 ); }