Here you can find the source of equalsRandomIterable(List> a, List> bl)
private static boolean equalsRandomIterable(List<?> a, List<?> bl)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { private static boolean equalsRandomIterable(List<?> a, List<?> bl) { Iterator<?> it = bl.iterator(); for (Object anA : a) { if (it.hasNext()) { Object o2 = it.next(); if (anA == o2) continue; if (anA == null) return false; if (!anA.equals(o2)) return false; } else return false; }//from w ww . j a v a2 s .c om return !it.hasNext(); } }