EnipPacket { public CommandCode getCommandCode() { return commandCode; } EnipPacket(CommandCode commandCode,
                      long sessionHandle,
                      EnipStatus status,
                      long senderContext,
                      @Nullable Command command); CommandCode getCommandCode(); long getSessionHandle(); EnipStatus getStatus(); long getSenderContext(); @Nullable Command getCommand(); @Override boolean equals(Object o); @Override int hashCode(); static ByteBuf encode(EnipPacket packet, ByteBuf buffer); static EnipPacket decode(ByteBuf buffer);  }
@Test(dataProvider = "getCommand") public void testSerialization(Command command) { EnipPacket packet = new EnipPacket( command.getCommandCode(), 1L, EnipStatus.EIP_SUCCESS, 2L, command ); EnipPacket decoded = encodeDecode(packet, EnipPacket::encode, EnipPacket::decode); assertEquals(packet, decoded); }