@Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Map.Entry<?, ?>) {
            Map.Entry<?, ?> other = (Map.Entry<?, ?>) obj;
            return ObjectUtils.equals(getKey(), other.getKey())
                    && ObjectUtils.equals(getValue(), other.getValue());
        }
        return false;
    }
<p>Compares this pair to another based on the two elements.</p>

@param obj  the object to compare to, null returns false
@return true if the elements of the pair are equal
android/android_framework/base/src/main/java/lang3/tuple/Pair.java