Is there a way to fill an array using java 8 Supplier ?
I would like to write:
Supplier supplier = () -> new Object(); Object[] arr
Alternative to Pshemo's solution you could use map method.
Object[] array = new Object[size]; array = Arrays.stream(array).map(a -> new Object()).toArray();