### Question:
ArrayUtil { @Deprecated public static <T> T[] union( T[] first, T[] other ) { if ( first == null || other == null ) { return first == null ? other : first; } int missing = missing( first, other ); if ( missing == 0 ) { return first; } T[] union = copyOf( first, first.length + missing ); int cursor = first.length; for ( T candidate : other ) { if ( !contains( first, candidate ) ) { union[cursor++] = candidate; missing--; } } assert missing == 0; return union; } private  ArrayUtil(); @Deprecated static int hashCode( Object array ); @Deprecated static boolean equals( Object firstArray, Object otherArray ); @Deprecated static boolean equals( Object firstArray, Object otherArray, ArrayEquality equality ); @Deprecated static Object clone( Object array ); @Deprecated static int missing( T[] array, T[] contains ); @Deprecated static boolean containsAll( T[] array, T[] contains ); @Deprecated static boolean contains( T[] array, T contains ); @Deprecated static boolean contains( T[] array, int arrayLength, T contains ); @Deprecated static boolean nullSafeEquals( T first, T other ); @Deprecated static T[] union( T[] first, T[] other ); @Deprecated static boolean isEmpty( Object[] array ); @Deprecated static String join( T[] items, String delimiter ); @Deprecated static TO[] map( FROM[] from, Function<FROM,TO> transformer, Class<TO> toClass ); @Deprecated static T[] concat( T first, T... additional ); @Deprecated static T[] concat( T[] initial, T... additional ); static T[] concatArrays( T[] initial, T[]... additional ); @Deprecated @SafeVarargs static T[] array( T... varargs ); @Deprecated static T lastOf( T[] array ); @Deprecated static int indexOf( T[] array, T item ); @Deprecated static T[] without( T[] source, T... toRemove ); @Deprecated static void reverse( T[] array ); @Deprecated
    static final ArrayEquality DEFAULT_ARRAY_EQUALITY; @Deprecated
    static final ArrayEquality BOXING_AWARE_ARRAY_EQUALITY; }### Answer:
@Test void shouldProduceUnionOfTwoArrays() { String[] first = {"one", "three"}; String[] other = {"two", "four", "five"}; String[] union = ArrayUtil.union( first, other ); assertEquals( asSet( "one", "two", "three", "four", "five" ), asSet( union ) ); }
@Test void shouldProduceUnionWhereFirstIsNull() { String[] first = null; String[] other = {"one", "two"}; String[] union = ArrayUtil.union( first, other ); assertEquals( asSet( "one", "two" ), asSet( union ) ); }
@Test void shouldProduceUnionWhereOtherIsNull() { String[] first = {"one", "two"}; String[] other = null; String[] union = ArrayUtil.union( first, other ); assertEquals( asSet( "one", "two" ), asSet( union ) ); }