DefaultRequestTransformer implements RequestTransformer { public static byte[] merge(byte[] array1, byte[] array2) { byte[] merged = new byte[array1.length + array2.length]; System.arraycopy(array1, 0, merged, 0, array1.length); System.arraycopy(array2, 0, merged, array1.length, array2.length); return merged; } DefaultRequestTransformer(KeyManager keyManager); @Override byte[] transformRequest(Request request); static byte[] merge(byte[] array1, byte[] array2);  }
@Test public void testMerge() { byte[] array1 = new byte[] { 'a', 'b', 'c' }; byte[] array2 = new byte[] { 'd', 'e' }; byte[] expected = new byte[] { 'd', 'e', 'a', 'b', 'c' }; byte[] merged = DefaultRequestTransformer.merge(array2, array1); assertArrayEquals(expected, merged); }