code: public static boolean equalsOrBothNull(final Object object1, final Object object2) {
          return object1 == null && object2 == null || object1 != null && object1.equals(object2);
      }
docs: Return true if the object are equals or both null.
  
  @param object1 first object to compare
  @param object2 second object to compare
  
  @return true if the object are equals or both null