public static boolean areEqual(final Element a, final Object b) {
        if (a == b)
            return true;
        if (null == b || null == a)
            return false;
        if (!((a instanceof Vertex && b instanceof Vertex) ||
                (a instanceof Edge && b instanceof Edge) ||
                (a instanceof VertexProperty && b instanceof VertexProperty)))
            return false;
        return haveEqualIds(a, (Element) b);
    }
A standard method for determining if two {@link Element} objects are equal. This method should be used by any
{@link Object#equals(Object)} implementation to ensure consistent behavior. This method is used for Vertex,
Edge, and VertexProperty.

@param a The first {@link Element}
@param b The second {@link Element} (as an {@link Object})
@return true if elements and equal and false otherwise
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java