@Test @DisplayName("Test that two arrays are joined together nicely") void arraysAreProperlyJoined() { Assertions.assertEquals("a,b,c,d,e", String.join(",", ArrayTools.join(new String[]{"a", "b"}, new String[]{"c", "d", "e"}))); }
public static <T> T[] join(T[] a, T[] b) { if (a == null) { return b; } else { if (b == null) { return a; } final var array = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, array, a.length, b.length); return array; } }
ArrayTools { public static <T> T[] join(T[] a, T[] b) { if (a == null) { return b; } else { if (b == null) { return a; } final var array = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, array, a.length, b.length); return array; } } }
ArrayTools { public static <T> T[] join(T[] a, T[] b) { if (a == null) { return b; } else { if (b == null) { return a; } final var array = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, array, a.length, b.length); return array; } }  }
ArrayTools { public static <T> T[] join(T[] a, T[] b) { if (a == null) { return b; } else { if (b == null) { return a; } final var array = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, array, a.length, b.length); return array; } }  static T[] join(T[] a, T[] b); }
ArrayTools { public static <T> T[] join(T[] a, T[] b) { if (a == null) { return b; } else { if (b == null) { return a; } final var array = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, array, a.length, b.length); return array; } }  static T[] join(T[] a, T[] b);  }