ArrayUtil { public static <T> T[] concat(@Nullable T element, T[] array) { return ObjectArrays.concat(element, array); }  @SuppressWarnings("unchecked") static T[] newArray(Class<T> type, int length); @SuppressWarnings("unchecked") static T[] toArray(Collection<T> col, Class<T> type); static T[] shuffle(T[] array); static T[] shuffle(T[] array, Random random); static T[] concat(@Nullable T element, T[] array); static T[] concat(T[] array, @Nullable T element); static List<T> asList(T... a); static List<Integer> intAsList(int... backingArray); static List<Long> longAsList(long... backingArray); static List<Double> doubleAsList(double... backingArray);  }
@Test public void contact() { String[] array = new String[] { "d", "a", "c" }; assertThat(ArrayUtil.concat("z", array)).containsExactly("z", "d", "a", "c"); assertThat(ArrayUtil.concat(array, "z")).containsExactly("d", "a", "c", "z"); }