Returns true if the given objects are equal or if both objects are null. @param o1 one of the objects to compare. @param o2 one of the objects to compare. @return true if the given objects are equal or if both objects are null.
(Object o1, Object o2)
| 35 | * @return {@code true} if the given objects are equal or if both objects are {@code null}. |
| 36 | */ |
| 37 | public static boolean areEqual(Object o1, Object o2) { |
| 38 | if (o1 == null) { |
| 39 | return o2 == null; |
| 40 | } |
| 41 | if (o1.equals(o2)) { |
| 42 | return true; |
| 43 | } |
| 44 | return areEqualArrays(o1, o2); |
| 45 | } |
| 46 | |
| 47 | public static boolean areEqualArrays(Object o1, Object o2) { |
| 48 | if (!isArray(o1) || !isArray(o2)) { |