@Override
    public default int compareTo(final Traverser<T> other) throws ClassCastException {
        final Object thisObj = this.get();
        final Object otherObj = other.get();
        if (thisObj == otherObj) return 0;
        if (null == thisObj) return -1;
        if (null == otherObj) return 1;
        return ((Comparable) thisObj).compareTo(otherObj);
    }
If the underlying object of the traverser is comparable, compare it with the other traverser.

@param other the other traverser that presumably has a comparable internal object
@return the comparison of the two objects of the traversers
@throws ClassCastException if the object of the traverser is not comparable
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traverser.java