class DefaultValueMapTraversal implements ValueMapTraversal {

    @Override
    public Optional<Map<String, Object>> getSingleResult() {
        List<Map<String, Object>> result = getResultList();
        if (result.isEmpty()) {
            return Optional.empty();
        }
        if (result.size() == 1) {
            return Optional.of(result.get(0));
        }
        throw new NonUniqueResultException("The Edge traversal query returns more than one result");
    }

      DefaultValueMapTraversal(Supplier<GraphTraversal<?, ?>> supplier, Function<GraphTraversal<?, ?>,
            GraphTraversal<Vertex, Map<String, Object>>> flow);

}