code: public static boolean elementsEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
      if (iterable1 instanceof Collection && iterable2 instanceof Collection) {
        Collection<?> collection1 = (Collection<?>) iterable1;
        Collection<?> collection2 = (Collection<?>) iterable2;
        if (collection1.size() != collection2.size()) {
          return false;
        }
      }
      return Iterators.elementsEqual(iterable1.iterator(), iterable2.iterator());
    }
docs: Determines whether two iterables contain equal elements in the same order. More specifically,
  this method returns {@code true} if {@code iterable1} and {@code iterable2} contain the same
  number of elements and every element of {@code iterable1} is equal to the corresponding element
  of {@code iterable2}.