@Override
        public int compare(final Object f, final Object s) {
            // nulls first
            if (f == null || s == null)
                return f == s ? 0 : f == null ? -1 : 1;

            final Type ft = Type.type(f);
            /*
             * Do a quick check to catch very common cases - class equality or both numerics. Even if these are false we
             * could still be dealing with the same type (e.g. different implementation of List), but let the type
             * lookup method handle that.
             */
            final Type st = f.getClass().equals(s.getClass()) || (f instanceof Number && s instanceof Number) ?
                    ft : Type.type(s);

            return ft != st ? ft.priority() - st.priority() : comparator(ft).compare(f, s);
        }
Compare two Gremlin value objects per the Orderability semantics.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/GremlinValueComparator.java