Value comparison between one CVE and one PVE.
@param e1 first expression
@param e2 second expression
@return whether one is CVE, the other is PVE, and their values equal.
482011
private static boolean valueConstantsMatch(AbstractExpression e1, AbstractExpression e2) {
        return (e1 instanceof ParameterValueExpression && e2 instanceof ConstantValueExpression ||
                e1 instanceof ConstantValueExpression && e2 instanceof ParameterValueExpression) &&
                equalsAsCVE(e1, e2);
    }
800519
@SuppressWarnings({ "unchecked" })
	protected int compare(E k1, E k2) {
		if (comparator == null) {
			return ((Comparable) k1).compareTo(k2);
		}
		return comparator.compare(k1, k2);
	}
137966
public int compare(NUMERICTYPE value1, NUMERICTYPE value2) {
        if (this.performCalculationsAsDoublePrimitive) {
            double v1 = value1.doubleValue();
            double v2 = value2.doubleValue();
            return Double.compare(v1, v2);
        } else {
            // evaluate as long
            long v1 = value1.longValue();
            long v2 = value2.longValue();
            return Long.compare(v1, v2);
        }

    }
265493
public static boolean isEqual(Object obj1, Object obj2) {
        if (obj1 != null) {
            return (obj2 != null) && obj1.equals(obj2);
        } else {
            return obj2 == null;
        }
    }
523673
public static boolean notEquals(final Object object1, final Object object2) {
        return object1 != null && !object1.equals(object2) || object1 == null && object2 != null;
    }
1176394
@Pure
	@Inline(value = "MathUtil.isEpsilonEqual($1, $2, Double.NaN)", imported = {MathUtil.class})
	public static boolean isEpsilonEqual(double v1, double v2) {
		return isEpsilonEqual(v1, v2, Double.NaN);
	}
240258
public static boolean keyMatch(String key1, String key2) {
        int i = key2.indexOf('*');
        if (i == -1) {
            return key1.equals(key2);
        }

        if (key1.length() > i) {
            return key1.substring(0, i).equals(key2.substring(0, i));
        }
        return key1.equals(key2.substring(0, i));
    }
1062662
private boolean isEqual(Object o1, Object o2)
    {
        // Both null - they are equal
        if (o1 == null && o2 == null)
        {
            return true;
        }
        // One is null and the other isn't - they are not equal
        if ((o1 == null && o2 != null) || (o1 != null && o2 == null))
        {
            return false;
        }

        // Otherwise fight it out amongst themselves
        return o1.equals(o2);
    }
371886
public static boolean isSibling(String p1, String p2)
   {
      int pos1 = p1.lastIndexOf('/');
      int pos2 = p2.lastIndexOf('/');
      return (pos1 == pos2 && pos1 >= 0 && p1.regionMatches(0, p2, 0, pos1));
   }
919598
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.candidatePreferred.compareTo(o2.candidatePreferred);
        }
        return -1;
    }
1019348
protected int compareKeysPartially(byte[] key1, byte[] key2) {
        int length = Math.min(key1.length, key2.length);
        for (int i=0; i<length; i++) {
            int a1 = key1[i];
            int a2 = key2[i];
            if (a1 != a2) {
                return (a1 & 0xff) - (a2 & 0xff);
            }
        }
        return 0;
    }
548662
public static boolean areEquals(final String s1, final String s2) {
        return s1 == null ? s2 == null : s1.equals(s2);
    }
131310
final static boolean valEquals(final Object o1, final Object o2) {
    return (o1 == null ? o2 == null : o1.equals(o2));
  }
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;
  }
468572
public boolean sameValue(Object value1, Object value2) {
    return ((BigDecimal)value1).compareTo((BigDecimal)value2) == 0;
  }
621112
public int compare(Object o1, Object o2) {
		List list1 = (List) o1;
		List list2 = (List) o2;

		for (int i = 0; i < list1.size(); i++) {
			if (list2.size() > i) {
				Comparable component1 = (Comparable) list1.get(i);
				Comparable component2 = (Comparable) list2.get(i);
				int componentsCompared = component1.compareTo(component2);
				if (componentsCompared != 0) {
					return componentsCompared;
				}
			}
			else {
				// First instance has more components, so that instance is
				// greater.
				return 1;
			}
		}

		// All components so far are equal - if the other instance has
		// more components it is greater otherwise they are equal.
		if (list2.size() > list1.size()) {
			return -1;
		}
		else {
			return 0;
		}
	}
854987
public static <E> int compare(final Comparable<E> obj1, final E obj2) {
        if (obj1 == obj2) {
            return 0;
        }
        if (obj1 == null) {
            return -1;
        }
        if (obj2 == null) {
            return 1;
        }

        return obj1.compareTo(obj2);
    }