code: @SuppressWarnings("unchecked")
    public static <T> T[] randomArrayFrom(Supplier<T> elementSupplier, int size) {
      checkArgument(size >= 0, "Size must be greater than or equal to zero");
      return (T[]) Stream.generate(elementSupplier).limit(size).toArray(Object[]::new);
    }
docs: Returns an array filled from the given element supplier.
  
  @param elementSupplier element supplier to fill array from
  @param size of the random array to return
  @param <T> the type of element the given supplier returns
  @return array filled from the given elements
  @throws IllegalArgumentException if the size is negative