public static boolean areEqual(final Property a, final Object b) {
        if (a == b)
            return true;
        if (null == b || null == a)
            return false;
        if (!(b instanceof Property))
            return false;
        if (!a.isPresent() && !((Property) b).isPresent())
            return true;
        if (!a.isPresent() && ((Property) b).isPresent() || a.isPresent() && !((Property) b).isPresent())
            return false;
        return a.key().equals(((Property) b).key()) && a.value().equals(((Property) b).value());

    }
A standard method for determining if two {@link Property} objects are equal. This method should be used by any
{@link Object#equals(Object)} implementation to ensure consistent behavior.

@param a the first {@link Property}
@param b the second {@link Property}
@return true if equal and false otherwise
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java