ObjectUtils { public static <T> int compare( final Comparable<T> o1, final T o2) { if (o1 == o2) { return 0; } if (null == o1) { return -1; } return o1.compareTo(o2); }  static String guid(); static String guid(
      final Object obj); static boolean equal(
      final Object obj1,
      final Object obj2); static int compare(
      final Comparable<T> o1,
      final T o2); static K nvl(
      final K... objs);  }
@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testCompare() { final Object[][] testParameters = new Object[][] {{"a", "a", 0}, {7, 1, 1}, {"ab", "abc", -1}}; assertEquals(-1, ObjectUtils.compare(null, "a")); for (final Object[] testParameter : testParameters) { int expected = (Integer) testParameter[2]; Comparable o1 = (Comparable) testParameter[0]; Object o2 = (Object) testParameter[1]; assertEquals(expected, ObjectUtils.compare(o1, o2)); } }