@Test
public void encode() throws Exception {

    assumeThat(payloadClazzName + " not yet implemented", notYetSupportedDataType, not(hasItem(payloadClazzName)));
    ArrayList<Object> out = new ArrayList<>();
    SUT.encode(null, plcRequestContainer, out);
    assertThat(out, hasSize(1));
    assertThat(out.get(0), instanceOf(AmsPacket.class));
    AmsPacket amsPacket = (AmsPacket) out.get(0);
    LOGGER.info("{}\nHexDump:\n{}", amsPacket, amsPacket.dump());
    if (amsPacket instanceof AdsWriteRequest) {
        AdsWriteRequest adsWriteRequest = (AdsWriteRequest) amsPacket;
        byte[] value = adsWriteRequest.getData().getBytes();
        if (payloadClazzName.equals(Boolean.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1}));
        } else if (payloadClazzName.equals(Byte.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1}));
        } else if (payloadClazzName.equals(Short.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1, 0x0}));
        } else if (payloadClazzName.equals(Integer.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1, 0x0, 0x0, 0x0}));
        } else if (payloadClazzName.equals(Long.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1, 0x0, 0x0, 0x0}));
        } else if (payloadClazzName.equals(BigInteger.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x1, 0x0, 0x0, 0x0}));
        } else if (payloadClazzName.equals(Float.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x0, 0x0, (byte) 0x80, 0x3F}));
        } else if (payloadClazzName.equals(Double.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, (byte) 0xF0, 0x3F}));
        } else if (payloadClazzName.equals(BigDecimal.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, (byte) 0xF0, 0x3F}));
        } else if (payloadClazzName.equals(String.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        } else if (payloadClazzName.equals(LocalTime.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        } else if (payloadClazzName.equals(LocalDate.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        } else if (payloadClazzName.equals(LocalDateTime.class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        } else if (payloadClazzName.equals(byte[].class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        } else if (payloadClazzName.equals(Byte[].class.getSimpleName())) {
            assertThat(value, equalTo(new byte[]{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00}));
        }
    }
}