### Question:
RollbackMessageEncoder implements MessageEncoder { @Override public void encode( Message message, ValuePacker packer ) throws IOException { checkArgument( message, RollbackMessage.class ); packer.packStructHeader( 0, RollbackMessage.SIGNATURE ); }  @Override void encode( Message message, ValuePacker packer );  }### Answer:
@Test void shouldEncodeRollbackMessage() throws Exception { encoder.encode( ROLLBACK, packer ); verify( packer ).packStructHeader( 0, RollbackMessage.SIGNATURE ); }
@Test void shouldFailToEncodeWrongMessage() { assertThrows( IllegalArgumentException.class, () -> encoder.encode( RESET, packer ) ); }