public default Optional<E> tryNext() {
        return this.hasNext() ? Optional.of(this.next()) : Optional.empty();
    }
Return an {@link Optional} of the next E object in the traversal.
If the traversal is empty, then an {@link Optional#empty()} is returned.

@return an optional of the next object in the traversal
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java