class CompareMethods { void testBoolean() { if(Boolean.compare(Boolean.TRUE, Boolean.FALSE) == 1) {} } void testConstInt() { int x = 2; int y = 3; int z = Integer.compare(x, y); if (z > 0) {} long l1 = Long.MIN_VALUE; long l2 = Long.MAX_VALUE; if (Long.compare(l1, l2) == Long.compareUnsigned(l1, l2)) {} double d1 = Double.NaN; double d2 = Double.NaN; if (Double.compare(d1, d2) == 0) {} } void testRelative(int x, int y, int[] data) { if (x < y) { int res = Integer.compare(x, y); if (res >= 0) {} } if (x != y) { int res = Long.compare(x, y); if (res == 0) {} } int r = Integer.compare(data.length, 0); if (r > 0) {} if (r == 0) {} if (r < 0) {} } }