Is there a way to fill an array using java 8 Supplier ?
I would like to write:
Supplier supplier = () -> new Object(); Object[] arr
You could easily write your own:
public static void fillArray(T[] array, Supplier extends T> supplier) { for(int k = 0; k < array.length; k++) array[k] = supplier.get(); }