public static boolean nullSafeEquals(@Nullable Object o1, @Nullable Object o2) {
        if (o1 == o2) {
            return true;
        }
        if (o1 == null || o2 == null) {
            return false;
        }
        if (o1.equals(o2)) {
            return true;
        }
        if (o1.getClass().isArray() && o2.getClass().isArray()) {
            return arrayEquals(o1, o2);
        }
        return false;
    }
Determine if the given objects are equal, returning {@code true} if
both are {@code null} or {@code false} if only one is {@code null}.
<p>Compares arrays with {@code Arrays.equals}, performing an equality
check based on the array elements rather than the array reference.

@param o1 first Object to compare
@param o2 second Object to compare
@return whether the given objects are equal
see Object#equals(Object)
see java.util.Arrays#equals
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/util/ObjectUtils.java