DefaultEdgeTraversal extends AbstractEdgeTraversal implements EdgeTraversal { @Override public EdgeTraversal filter(Predicate<EdgeEntity> predicate) { requireNonNull(predicate, "predicat is required"); Predicate<Traverser<Edge>> p = e -> predicate.test(converter.toEdgeEntity(e.get())); return new DefaultEdgeTraversal(supplier, flow.andThen(g -> g.filter(p)), converter); } DefaultEdgeTraversal(Supplier<GraphTraversal<?, ?>> supplier,
                         Function<GraphTraversal<?, ?>, GraphTraversal<Vertex, Edge>> flow,
                         GraphConverter converter); @Override EdgeTraversal has(String propertyKey); @Override EdgeTraversal has(String propertyKey, Object value); @Override EdgeTraversal has(String propertyKey, P<?> predicate); @Override EdgeTraversal has(T accessor, Object value); @Override EdgeTraversal has(T accessor, P<?> predicate); @Override EdgeTraversal hasNot(String propertyKey); @Override EdgeTraversal filter(Predicate<EdgeEntity> predicate); @Override EdgeTraversal limit(long limit); @Override EdgeTraversal range(long start, long end); @Override EdgeRepeatTraversal repeat(); @Override VertexTraversal inV(); @Override VertexTraversal outV(); @Override VertexTraversal bothV(); @Override Optional<EdgeEntity> next(); @Override Optional<EdgeEntity> getSingleResult(); @Override List<EdgeEntity> getResultList(); @Override Stream<EdgeEntity> stream(); @Override Stream<EdgeEntity> next(int limit); @Override ValueMapTraversal valueMap(String... propertyKeys); @Override EdgeTraversalOrder orderBy(String property); @Override long count();  }
@Test public void shouldReturnErrorWhenPredicateIsNull() { assertThrows(NullPointerException.class, () -> graphTemplate.getTraversalEdge().filter(null)); }