BootiqueUtils { static String[] mergeArrays(String[] a1, String[] a2) { if (a1.length == 0) { return a2; } if (a2.length == 0) { return a1; } String[] merged = new String[a1.length + a2.length]; System.arraycopy(a1, 0, merged, 0, a1.length); System.arraycopy(a2, 0, merged, a1.length, a2.length); return merged; } private  BootiqueUtils();   }
@Test public void testMergeArrays() { assertArrayEquals(new String[]{}, BootiqueUtils.mergeArrays(new String[0], new String[0])); assertArrayEquals(new String[]{"a"}, BootiqueUtils.mergeArrays(new String[]{"a"}, new String[0])); assertArrayEquals(new String[]{"b"}, BootiqueUtils.mergeArrays(new String[0], new String[]{"b"})); assertArrayEquals(new String[]{"b", "c", "d"}, BootiqueUtils.mergeArrays(new String[]{"b", "c"}, new String[]{"d"})); }