@Test public void testDoubles() { assertEquals(true, ComparisonUtils.compare(1d, 2d).isDifferent()); assertEquals(false, ComparisonUtils.compare(1d, 1d).isDifferent()); assertEquals(true, ComparisonUtils.compare(1d, -1d).isDifferent()); assertEquals(false, ComparisonUtils.compare(Double.valueOf(1), Double.valueOf(1)).isDifferent()); assertEquals(true, ComparisonUtils.compare(Double.valueOf(1), Double.valueOf(2)).isDifferent()); assertEquals(true, ComparisonUtils.compare(Double.valueOf(1), Double.valueOf(-1)).isDifferent()); assertEquals(false, ComparisonUtils.compare(Double.valueOf(1.0124d), Double.valueOf(1.0123d)).isDifferent()); assertEquals(false, ComparisonUtils.compare(Double.valueOf(0.00000124d), Double.valueOf(0.00000123d)).isDifferent()); assertEquals(true, ComparisonUtils.compare(Double.valueOf(1.0124d), Double.valueOf(1.0123d),BigDecimal.valueOf(0),BigDecimal.valueOf(0)).isDifferent()); }
public static ComparisonResult compare(Object o1, Object o2) { return compare(o1, o2, DEFAULT_SMALLEST_ABSOLUTE_VALUE, DEFAULT_TOLERANCE_PERCENTAGE); }
ComparisonUtils { public static ComparisonResult compare(Object o1, Object o2) { return compare(o1, o2, DEFAULT_SMALLEST_ABSOLUTE_VALUE, DEFAULT_TOLERANCE_PERCENTAGE); } }
ComparisonUtils { public static ComparisonResult compare(Object o1, Object o2) { return compare(o1, o2, DEFAULT_SMALLEST_ABSOLUTE_VALUE, DEFAULT_TOLERANCE_PERCENTAGE); }  }
ComparisonUtils { public static ComparisonResult compare(Object o1, Object o2) { return compare(o1, o2, DEFAULT_SMALLEST_ABSOLUTE_VALUE, DEFAULT_TOLERANCE_PERCENTAGE); }  static BigDecimal absoluteDifference(BigDecimal o1, BigDecimal o2); static BigDecimal percentageDifference(BigDecimal o1, BigDecimal o2); static ComparisonResult compare(Object o1, Object o2); static ComparisonResult compare(Object o1, Object o2, boolean equalsIgnoreCase); static ComparisonResult compare(Object o1, Object o2, BigDecimal smallestAbsoluteValue, BigDecimal tolerancePercentage); static ComparisonResult compare(Object o1, Object o2, BigDecimal smallestAbsoluteValue, BigDecimal tolerancePercentage, boolean equalsIgnoreCase); }
ComparisonUtils { public static ComparisonResult compare(Object o1, Object o2) { return compare(o1, o2, DEFAULT_SMALLEST_ABSOLUTE_VALUE, DEFAULT_TOLERANCE_PERCENTAGE); }  static BigDecimal absoluteDifference(BigDecimal o1, BigDecimal o2); static BigDecimal percentageDifference(BigDecimal o1, BigDecimal o2); static ComparisonResult compare(Object o1, Object o2); static ComparisonResult compare(Object o1, Object o2, boolean equalsIgnoreCase); static ComparisonResult compare(Object o1, Object o2, BigDecimal smallestAbsoluteValue, BigDecimal tolerancePercentage); static ComparisonResult compare(Object o1, Object o2, BigDecimal smallestAbsoluteValue, BigDecimal tolerancePercentage, boolean equalsIgnoreCase); static final BigDecimal DEFAULT_TOLERANCE_PERCENTAGE; static final BigDecimal DEFAULT_SMALLEST_ABSOLUTE_VALUE; }