_Arrays { @Nullable public static <T, R> R[] map( @Nullable T[] array, @NonNull Class<R> resultElementType, @NonNull Function<T, R> mapper) { if (array == null) { return null; } val mappedArray = _Casts.<R[]>uncheckedCast( Array.newInstance(resultElementType, array.length)); int i = 0; for (val element : array) { mappedArray[i++] = mapper.apply(element); } return mappedArray; }  static boolean testAnyMatch(
            @Nullable final T[] array1, 
            @Nullable final T[] array2, 
            final BiPredicate<T, T> test); static boolean testAllMatch(
            @Nullable final T[] array1, 
            @Nullable final T[] array2, 
            final BiPredicate<T, T> test); static boolean isArrayType(@Nullable final Class<?> cls); static boolean isCollectionOrArrayType(final Class<?> cls); static Collector<T,?,T[]> toArray(final Class<T> componentType, final int length); static Collector<T,?,T[]> toArray(final Class<T> componentType); @SafeVarargs static T[] combine(T first, @Nullable  T... rest); @SafeVarargs static T[] combineWithExplicitType(Class<T> type, X first, @Nullable  Y... rest); @SafeVarargs static T[] combine(T[] first, T... rest); static T[] toArray(@Nullable final Collection<? extends T> collection, final Class<T> componentType); static T[] toArray(@Nullable final Iterable<? extends T> iterable, final Class<T> componentType); static T[] removeByIndex(T[] array, int index); static @Nullable T[] emptyToNull(T[] array); static @Nullable Class<?> inferComponentTypeIfAny(@Nullable final Class<?> arrayType); static Optional<T> get(@Nullable T[] array, int index); @Nullable static R[] map(
            @Nullable T[] array, 
            @NonNull Class<R> resultElementType, 
            @NonNull Function<T, R> mapper); @Nullable static Object[] map(
            @Nullable T[] array, 
            @NonNull Function<T, ?> mapper); @Nullable static R[] mapCollection(
            @Nullable Collection<T> collection, 
            @NonNull Class<R> resultElementType, 
            @NonNull Function<T, R> mapper); @Nullable static Object[] mapCollection(
            @Nullable Collection<T> collection, 
            @NonNull Function<T, ?> mapper);  }
@Test void testMapTArrayClassOfRFunctionOfTR() { assertEquals(null, _Arrays.map((Integer[])null, Long.class, Long::valueOf)); assertArrayEquals(new Long[] {}, _Arrays.map(new Integer[] {}, Long.class, Long::valueOf)); assertArrayEquals(new Long[] {1L, 2L, 3L}, _Arrays.map(new Integer[] {1, 2, 3}, Long.class, Long::valueOf)); }
@Test void testMapTArrayFunctionOfTQ() { assertEquals(null, _Arrays.map((Integer[])null, Long::valueOf)); assertArrayEquals(new Long[] {}, _Arrays.map(new Integer[] {}, Long::valueOf)); assertArrayEquals(new Long[] {1L, 2L, 3L}, _Arrays.map(new Integer[] {1, 2, 3}, Long::valueOf)); }