@Test
public void trimTrailingBytes() {

    assertThat(ArrayUtils.trimTrailingBytes(new byte[]{0x01, 0x02, 0x03}, (byte) 0x03),
            is(new byte[]{0x01, 0x02}));
    assertThat(ArrayUtils.trimTrailingBytes(new byte[]{0x05, 0x02, 0x02}, (byte) 0x02),
            is(new byte[]{0x05}));
    assertThat(ArrayUtils.trimTrailingBytes(new byte[]{0x05, 0x02, 0x03}, (byte) 0x02),
            is(new byte[]{0x05, 0x02, 0x03}));
}