android/guava/src/com/google/common/collect/Iterables.java
public static boolean isEmpty(Iterable<?> iterable) {
    if (iterable instanceof Collection) {
      return ((Collection<?>) iterable).isEmpty();
    }
    return !iterable.iterator().hasNext();
  }
public static boolean isEmpty(Iterable<?> iterable) {
    if (iterable instanceof Collection) {
      return ((Collection<?>) iterable).isEmpty();
    }
    return !iterable.iterator().hasNext();
  }
Determines if the given iterable contains no elements.

<p>There is no precise {@link Iterator} equivalent to this method, since one can only ask an
iterator whether it has any elements <i>remaining</i> (which one does using {@link
Iterator#hasNext}).

<p><b>{@code Stream} equivalent:</b> {@code !stream.findAny().isPresent()}

@return {@code true} if the iterable contains no elements