public static <T> T[] randomArrayFrom(Iterable<T> elements, Range<Integer> size) {
    checkArgument(!isEmpty(elements), "Elements to populate random array from must not be empty");
    return randomArrayFrom(() -> IterableUtils.randomFrom(elements), size);
  }
public static < T > T [ ] randomArrayFrom ( Iterable < T > elements , Range < Integer > size ) { checkArgument ( ! isEmpty ( elements ) , "Elements to populate random array from must not be empty" ) ; return randomArrayFrom ( ( ) -> IterableUtils . randomFrom ( elements ) , size ) ; }
Returns an array filled randomly from the given elements.

@param elements elements to randomly fill array from
@param size range that the size of the array will be randomly chosen from
@param <T> the type of elements in the given iterable
@return array filled randomly from the given elements
@throws IllegalArgumentException if the elements to fill array from is empty or if the size
range contains negative integers