code: public static <T> /* @Nullable */ T random(final @NonNull Random random, final @NonNull Iterable<T> iterable) {
      final int size = Iterables.size(iterable);
      if(size == 0) {
        throw new IndexOutOfBoundsException("cannot get random value from empty iterable");
      }
      final int index = random.nextInt(size);
      return Iterables.get(iterable, index);
    }
docs: Gets a random element from an iterable.
  
  @param random the random
  @param iterable the iterable
  @param <T> the type
  @return a random element