Test two DBIDs for equality.

@param id1 First ID
@param id2 Second ID
@return Comparison result
187499
public static boolean equal(DBIDRef id1, DBIDRef id2) {
    return DBIDFactory.FACTORY.equal(id1, id2);
  }
743503
public static <T> boolean isEqual(final T first, final T second) {
        /* test to see if they are both null, or both reference the same object */
        if (first == second) return true;

        if (first == null && second != null) return false;

        return first.equals(second);
    }
762307
@Override
  public ArrayModifiableDBIDs order(DBIDs ids) {
    ArrayModifiableDBIDs res = DBIDUtil.newArray(ids.size());
    for(DBIDIter it = this.ids.iter(); it.valid(); it.advance()) {
      if(ids.contains(it)) {
        res.add(it);
      }
    }
    return res;
  }
195587
public static boolean equal(final Throwable ex1, final Throwable ex2) {
        if (ex1 == ex2) {
            return true;
        }
        if (ex1 == null) {
            if (ex2 != null) {
                return false;
            }
        } else if (ex2 == null) {
            if (ex1 != null) {
                return false;
            }
        } else {
            if (ex1.getClass() != ex2.getClass()) {
                return false;
            }
            if (ex1.getMessage() == null) {
                if (ex2.getMessage() != null) {
                    return false;
                }
            } else if (!ex1.getMessage().equals(ex2.getMessage())) {
                return false;
            }
            if (!equal(ex1.getCause(), ex2.getCause())) {
                return false;
            }
        }
        return true;
    }
785974
public static ModifiableDBIDs difference(DBIDs ids1, DBIDs ids2) {
    ModifiableDBIDs result = DBIDUtil.newHashSet(ids1);
    result.removeDBIDs(ids2);
    return result;
  }
1138117
private static int internalIntersectionSize(DBIDs first, DBIDs second) {
    second = second.size() > 16 && !(second instanceof SetDBIDs) ? newHashSet(second) : second;
    int c = 0;
    for(DBIDIter it = first.iter(); it.valid(); it.advance()) {
      if(second.contains(it)) {
        c++;
      }
    }
    return c;
  }
772657
private boolean contains(String ids[], String id) {
	for (int i = 0; i < ids.length; i++) {
	    if (Operator.compare(ids[i], id) == 0) return true;
	}
	return false;
    }
1215752
@Override
    public Pair<T1, T2> generateId() {
        return new Pair<T1, T2>(firstIdGenerator.generateId(), secondIdGenerator.generateId());
    }
1131586
public static boolean isLessOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) <= 0;
	}
511861
public static int intersectionSize(DBIDs first, DBIDs second) {
    // If exactly one is a Set, use it as second parameter.
    if(second instanceof SetDBIDs) {
      if(!(first instanceof SetDBIDs)) {
        return internalIntersectionSize(first, second);
      }
    }
    else if(first instanceof SetDBIDs) {
      return internalIntersectionSize(second, first);
    }
    // Both are the same type: both set or both non set.
    // Smaller goes first.
    return first.size() <= second.size() ? internalIntersectionSize(first, second) : internalIntersectionSize(second, first);
  }
500563
public static boolean compareQNameLists(List<QName> list1, List<QName> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!compareQNames(list1.get(i), list2.get(i)))
                return false;
        }

        return true;
    }
631108
public static <T> boolean compareInstance(T t1, T t2) {
        if (t1 == t2) {
            return true;
        }
        if (t1 != null && t2 != null && t1.equals(t2)) {
            return true;
        }

        return false;
    }
864486
@Override
    public int compare(T server1, T server2) {
        LoadBalancerStats lbStats = getLoadBalancerStats();
        ServerStats stats1 = lbStats.getSingleServerStat(server1);
        ServerStats stats2 = lbStats.getSingleServerStat(server2);
        int failuresDiff = (int) (stats2.getFailureCount() - stats1.getFailureCount());
        if (failuresDiff != 0) {
            return failuresDiff;
        } else {
            return (stats2.getActiveRequestsCount() - stats1.getActiveRequestsCount());
        }
    }
377824
private boolean isEqual(Object fld1, Object fld2)
    {
        if (fld1 == null || fld2 == null)
        {
            return (fld1 == fld2);
        }
        else if ((fld1 instanceof BigDecimal) && (fld2 instanceof BigDecimal))
        {
            return (((BigDecimal) fld1).compareTo((BigDecimal) fld2) == 0);
        }
        else if ((fld1 instanceof Date) && (fld2 instanceof Date))
        {
            return (((Date) fld1).getTime() == ((Date) fld2).getTime());
        }
        else
        {
            return fld1.equals(fld2);
        }
    }
676026
public Integer getAndIncrementIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        Integer count = this.idCounts.get(id);
        if (count == null) {
            count = Integer.valueOf(1);
        }
        this.idCounts.put(id, Integer.valueOf(count.intValue() + 1));
        return count;
    }
745608
private static ModifiableDBIDs internalIntersection(DBIDs first, DBIDs second) {
    second = second.size() > 16 && !(second instanceof SetDBIDs) ? newHashSet(second) : second;
    ModifiableDBIDs inter = newHashSet(first.size());
    for(DBIDIter it = first.iter(); it.valid(); it.advance()) {
      if(second.contains(it)) {
        inter.add(it);
      }
    }
    return inter;
  }
1228490
function compareRelids(a, b) {
            var aRel = self.getRelid(a),
                bRel = self.getRelid(b);

            if (aRel < bRel) {
                return -1;
            } else if (aRel > bRel) {
                return 1;
            } else {
                return 0;
            }
        }