Compares two strings for equality. Either or both of the values may be null.

@param s1
@param s2
@return true iff the two strings are equal
344567
public static boolean compareStrings(String s1, String s2) {
        if (s1 == s2)
            return true;
        if (s1 != null && s2 != null && s1.equals(s2))
            return true;
        return false;
    }
1273082
public static boolean areStringsEqual(String s1, String s2) {
    return s1 != null && s1.equals(s2) || s1 == null && s2 == null;
  }
1015744
public static boolean ne(String s1, String s2, int modifier) {
        return !isEqual(s1, s2, modifier);
    }
97866
public static boolean equalsValue(final Integer i1, final Integer i2) {
        if (i1 == null) {
            return i2 == null;
        }
        return i1.equals(i2);
    }
335507
public static boolean areEqualsIgnoreCaseAndTrim(final String s1, final String s2) {
        if (s1 == null && s2 == null) {
            return true;
        } else if (s1 != null && s2 != null) {
            return s1.trim().equalsIgnoreCase(s2.trim());
        } else {
            return false;
        }
    }
667441
public static boolean compareQNames(QName qn1, QName qn2) {
        if (qn1 == qn2)
            return true;
        if (qn1 == null || qn2 == null)
            return false;
        return qn1.equals(qn2);
    }
1025804
public static int compare(CharSequence s1, CharSequence s2)
    {
        return compare(s1, s2, Funcs::same);
    }
1302447
public static boolean bothNullOrEqual(Object a, Object b) {
        return (a == null || b == null) ? (a == b) : a.equals(b);
    }
955445
public int compare(final SnomedConcept o1, final SnomedConcept o2) {
        if (o1 == o2) return 0;
        if (o1 != null) {
            if (o2 == null) return 1;
            else return o1.phraseText.compareTo(o2.phraseText);
        }
        return -1;
    }
166374
@Override
  public int compare(S solution1, S solution2) {
    if (solution1 == null) {
      return 1;
    } else if (solution2 == null) {
      return -1;
    }

    double fitness1 = solutionFitness.getAttribute(solution1);
    double fitness2 = solutionFitness.getAttribute(solution2);
    if (fitness1 < fitness2) {
      return -1;
    }

    if (fitness1 > fitness2) {
      return 1;
    }

    return 0;
  }
261135
public static boolean equalsValue(final BigDecimal bd1, final BigDecimal bd2) {
        if (bd1 == null) {
            return bd2 == null;
        }
        return BigDecimalUtil.isSameValue(bd1, bd2);
    }
179460
private boolean checkEquality(HashMap<String, Double> a,
			HashMap<String, Double> b) {
		for(String s: a.keySet()){
			if(Double.compare(a.get(s), b.get(s)) != 0)
				return false;
		}
		return true;
	}
950952
private boolean isEqual(Object a, Object b) {

        if (a == null) {
            return (b == null);
        }
        if (b == null) {
            return false;
        }
        return a.equals(b);
    }
1024240
public boolean areEquals(String str1, String str2) {

		return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
	}
581102
protected final boolean compareKeys(K k1, K k2) {
        return k1 == k2 || (k1 != null && k1.equals(k2));
    }
816023
public static boolean equalsAny(final Object o1, final Object... o2s) {
        if (o2s != null) {
            for (final Object o2 : o2s) {
                if (o1 == null) {
                    if (o2 == null) {
                        return true;
                    }
                    continue;
                }
                // o1 != null
                if (o1.equals(o2)) {
                    return true;
                }
            }
        } else {
            return o1 == null;
        }
        return false;
    }
313067
public static boolean equal(Object one, Object two) {
		return one == null && two == null || !(one == null || two == null) && (one == two || one.equals(two));
	}