List of utility methods to do Collection Equal
boolean | equalTestData(Collection equal Test Data if (receivedDataSet.size() != TEST_DATA.length) { return false; for (String td : TEST_DATA) { if (!receivedDataSet.contains(td)) { return false; return true; |
T | getContainedEquals(Collection get Contained Equals for (T t : a) { if (b.equals(t)) return t; return null; |
int | indexOfEquals(Collection index Of Equals int pos = 0; for (T e : collection) { if (element.equals(e)) return pos; pos++; return -1; |
boolean | isCollectionEqual(Collection is Collection Equal if (c1 == null) { return c2 == null; if (c2 == null) { return false; return c1.size() == c2.size() && c1.containsAll(c2); |
boolean | isCollectionsEqual(Collection f1, Collection f2) Compare two collections. if ((f1 == null && f2 != null) || (f1 != null && f2 == null)) { return false; if (f1 != null) { if ((f1.size() != f2.size()) || !isC2InC1(f1, f2) || !isC2InC1(f2, f1)) { return false; return true; |
boolean | isContentEqual(final Collection> collectionA, final Collection> collectionB) Method checks if the given collections contain the same content. if (collectionA == null || collectionB == null) { throw new IllegalArgumentException("parameters can not be null."); if (collectionA.size() != collectionB.size()) { return false; for (Object obj : collectionA) { if (!collectionB.contains(obj)) { ... |
boolean | isEqual(Collection left, Collection right) is Equal if (left != null && right != null) { return left.toString().equals(right.toString()); } else { return left == right; |
boolean | isEqual(Collection one, Collection two) Calculates the equality of two collections disregarding the underlying implementation. if (one == null && two != null) { return false; if (one != null && two == null) { return false; if (one == two) { return true; ... |
boolean | isEqual(Collection extends T> coll, Comparator super T> comp) is Equal Iterator<? extends T> i = coll.iterator(); T first = i.next(); while (i.hasNext()) { T next = i.next(); if (comp.compare(first, next) < 0) { return false; return true; |
boolean | isEqual(Collection is Equal if (a == null) { return b == null; if (b == null) { return false; if (a.size() != b.size()) { return false; ... |