### Question:
AsnBtpErrorDataCodec extends AsnBtpPacketDataCodec<BtpError> { @Override public void encode(final BtpError value) { Objects.requireNonNull(value); setValueAt(0, value.getErrorCode().getCodeIdentifier()); setValueAt(1, value.getErrorCode().getCodeName()); setValueAt(2, value.getTriggeredAt()); setValueAt(3, value.getErrorData()); setValueAt(4, value.getSubProtocols()); } AsnBtpErrorDataCodec(long requestId); @Override BtpError decode(); @Override void encode(final BtpError value);  }### Answer:
@Test public void encode() { codec.encode(btpError); assertThat((short) codec.getValueAt(0)).isEqualTo(btpError.getType().getCode()); assertThat((long) codec.getValueAt(1)).isEqualTo(btpError.getRequestId()); assertThat((BtpError) codec.getValueAt(2)).isEqualTo(btpError); final BtpError decodedBtpError = codec.decode(); assertThat(decodedBtpError).isEqualTo(btpError); }