code: public static boolean areElementsEqual(
              Iterable<?> iterable1, Iterable<?> iterable2)
     {
        if (iterable1 == null || iterable2 == null)
        {
           return false;
        }
        Iterator<?> iterator1 = iterable1.iterator();
        Iterator<?> iterator2 = iterable2.iterator();
        while (iterator1.hasNext())
        {
           if (!iterator2.hasNext())
           {
              return false;
           }
           Object o1 = iterator1.next();
           Object o2 = iterator2.next();
           if (!areEqual(o1, o2))
           {
              return false;
           }
        }
        return !iterator2.hasNext();
     }
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}.