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 ) ; }
Checks if two objects are equal handling null .