@Test
public void testConcatenate() {

    assertThat(concatenate(new byte[]{0x01, 0x02, 0x03}, new byte[]{0x04}), is(new byte[]{0x01, 0x02, 0x03, 0x04}));
    assertThat(concatenate(new byte[]{0x01, 0x02, 0x03}, (byte) 0x04), is(new byte[]{0x01, 0x02, 0x03, 0x04}));
    assertThat(concatenate((byte) 0x04, new byte[]{0x01, 0x02, 0x03}), is(new byte[]{0x04, 0x01, 0x02, 0x03}));
    assertThat(concatenate(new byte[]{0x01, 0x02, 0x03}, new byte[]{0x01, 0x02, 0x03}, new byte[]{0x04}), is(new byte[]{0x01, 0x02, 0x03, 0x01, 0x02, 0x03, 0x04}));
    assertThat(concatenate(new byte[]{}, new byte[]{0x01, 0x02, 0x03}, new byte[]{}, new byte[]{0x01}), is(new byte[]{0x01, 0x02, 0x03, 0x01}));
}