public static Type type(final Object o) {
            if (o == null)
                return Nulltype;

            final Type[] types = Type.values();
            for (int i = 1; i < types.length; i++) {
                if (types[i].type.isInstance(o)) {
                    return types[i];
                }
            }
            return Unknown;
        }
Lookup by instanceof semantics (not class equality). Current implementation will return first enum value
that matches the object's type.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparator.java