### Question:
Utils { static byte[] concatenate(byte[] a, byte[] b) { byte[] ret = new byte[a.length + b.length]; System.arraycopy(a, 0, ret, 0, a.length); System.arraycopy(b, 0, ret, a.length, b.length); return ret; }    }### Answer:
@Test(expected = NullPointerException.class) public void testConcatenate_wNullA() { Utils.concatenate(new byte[] {1, 2}, null); }
@Test(expected = NullPointerException.class) public void testConcatenate_wNullB() { Utils.concatenate(null, new byte[] {1, 2}); }
@Test public void testConcatenate() { assertThat(Utils.concatenate(new byte[] {1, 2}, new byte[] {3, 4})) .isEqualTo(new byte[] {1, 2, 3, 4}); }
@Test public void testConcatenate_wEmptyFirstArray() { assertThat(Utils.concatenate(new byte[] {}, new byte[] {3, 4})) .isEqualTo(new byte[] {3, 4}); }
@Test public void testConcatenate_wEmptySecondArray() { assertThat(Utils.concatenate(new byte[] {1, 2}, new byte[] {})) .isEqualTo(new byte[] {1, 2}); }
@Test public void testConcatenate_wEmptyArrays() { assertThat(Utils.concatenate(new byte[] {}, new byte[] {})).isEqualTo(new byte[] {}); }