@Test public void testObjectsEqual() throws InterruptedException { Calendar instance = Calendar.getInstance(); Calendar copy = Calendar.getInstance(); copy.setTimeInMillis(instance.getTimeInMillis()); Assert.assertTrue(CompareUtil.compareObjectsAndNull(instance, copy)); }
public static boolean compareObjectsAndNull(Object object1, Object object2) { if ((object1 == null && object2 == null) || (object1 != null && object1.equals(object2))) { return true; } else { return false; } }
CompareUtil { public static boolean compareObjectsAndNull(Object object1, Object object2) { if ((object1 == null && object2 == null) || (object1 != null && object1.equals(object2))) { return true; } else { return false; } } }
CompareUtil { public static boolean compareObjectsAndNull(Object object1, Object object2) { if ((object1 == null && object2 == null) || (object1 != null && object1.equals(object2))) { return true; } else { return false; } }  }
CompareUtil { public static boolean compareObjectsAndNull(Object object1, Object object2) { if ((object1 == null && object2 == null) || (object1 != null && object1.equals(object2))) { return true; } else { return false; } }  static boolean compareObjectsAndNull(Object object1, Object object2); static boolean compareArraysAndNull(Object[] arg1, Object[] arg2); static boolean compareListsAndNull(List arg1, List arg2); }
CompareUtil { public static boolean compareObjectsAndNull(Object object1, Object object2) { if ((object1 == null && object2 == null) || (object1 != null && object1.equals(object2))) { return true; } else { return false; } }  static boolean compareObjectsAndNull(Object object1, Object object2); static boolean compareArraysAndNull(Object[] arg1, Object[] arg2); static boolean compareListsAndNull(List arg1, List arg2);  }