public static Object[] map(Function function, D[] array) { return Arrays.stream(array) .map(function) .toArray(); }