Java Utililty Methods Collection Equal

List of utility methods to do Collection Equal

Description

The list of methods to do Collection Equal are organized into topic(s).

Method

intisEqualBasicCol(Collection col1, Collection col2)
is Equal Basic Col
if (col1 == col2) {
    return B_TRUE;
} else if (col1 == null || col2 == null) {
    if (col1 == null) {
        if (col2.size() == 0)
            return B_TRUE;
        else
            return B_FALSE;
...
booleanisEqualCollection(final Collection a, final Collection b)
Returns true iff the given Collection s contain exactly the same elements with exactly the same cardinality.
if (a.size() != b.size()) {
    return false;
} else {
    Map mapa = getCardinalityMap(a);
    Map mapb = getCardinalityMap(b);
    if (mapa.size() != mapb.size()) {
        return false;
    } else {
...
booleanisEqualCollection(final Collection a, final Collection b)
Returns true iff the given Collection s contain exactly the same elements with exactly the same cardinality.
if (a.size() != b.size()) {
    return false;
} else {
    Map mapa = getCardinalityMap(a);
    Map mapb = getCardinalityMap(b);
    if (mapa.size() != mapb.size()) {
        return false;
    } else {
...
booleanisEqualDeep(Collection a, Collection b)
Asks if two collections are equal by comparing them deeply.
if (a == null && b == null)
    return true;
if (a == null)
    return false;
if (b == null)
    return false;
for (Object o : a) {
    if (!b.contains(a))
...
booleanisEquals(Collection set1, Collection set2)
is Equals
if (set1.size() == set2.size()) {
    return isSubset(set1, set2);
return false;
booleanisEqualsSize(Collection res, Collection des)
is Equals Size
if (res.size() == des.size()) {
    return true;
} else {
    return false;
booleanorderedEqual(Collection c1, Collection c2)
ordered Equal
if (c1.size() != c2.size())
    return false;
Iterator<T> i1 = c1.iterator(), i2 = c2.iterator();
while (i1.hasNext() && i2.hasNext()) {
    T t1 = i1.next(), t2 = i2.next();
    if ((t1 == null) != (t2 == null))
        return false;
    if (t1 != null) {
...