code: public static boolean equal(Object obj1, Object obj2) {
          if (obj1 == obj2) {
              return true;
          }
          if (obj1 == null || obj2 == null) {
              return false;
          }
          if (obj1.getClass().isArray()) {
              return equalsArray(obj1, obj2);
          }
          // this does not handle arrays embedded in objects, such as in lists/maps
          // but you shouldn't use arrays like that, should you?
          return obj1.equals(obj2);
      }
docs: Checks if two objects are equal handling null.
  
  @param obj1  the first object, may be null
  @param obj2  the second object, may be null
  @return true if equal