Android Utililty Methods Iterable Compare

List of utility methods to do Iterable Compare

Description

The list of methods to do Iterable Compare are organized into topic(s).

Method

intcompareAsIterable( @Nonnull Comparator comparator, @Nonnull Iterable it1, @Nonnull Iterable it2)
compare As Iterable
Iterator<? extends T> elements2 = it2.iterator();
for (T element1 : it1) {
    T element2;
    try {
        element2 = elements2.next();
    } catch (NoSuchElementException ex) {
        return 1;
    int res = comparator.compare(element1, element2);
    if (res != 0)
        return res;
if (elements2.hasNext()) {
    return -1;
return 0;
intcompareAsIterable( @Nonnull Iterable it1, @Nonnull Iterable it2)
compare As Iterable
Iterator<? extends T> elements2 = it2.iterator();
for (T element1 : it1) {
    T element2;
    try {
        element2 = elements2.next();
    } catch (NoSuchElementException ex) {
        return 1;
    int res = element1.compareTo(element2);
    if (res != 0)
        return res;
if (elements2.hasNext()) {
    return -1;
return 0;