@Test public void emptyIfGraphDoesntContainEndVertex() { builder.getGraph().removeVertex(END_VERTEX); ChangesOperation changesOperation = new ChangesOperation(); SetResult<Vertex> result = changesOperation.execute(builder.getGraph()); assertTrue(result.get().isEmpty()); }
@Override public SetResult<Vertex> execute(Graph<Vertex, Edge> graph) { return new SetResult<>(emptyIfFalse(graph.containsVertex(END_VERTEX), () -> graph.edgesOf(END_VERTEX).stream().map(Edge::getTarget))); }
ChangesOperation extends AbstractGraphOperation<SetResult<Vertex>> { @Override public SetResult<Vertex> execute(Graph<Vertex, Edge> graph) { return new SetResult<>(emptyIfFalse(graph.containsVertex(END_VERTEX), () -> graph.edgesOf(END_VERTEX).stream().map(Edge::getTarget))); } }
ChangesOperation extends AbstractGraphOperation<SetResult<Vertex>> { @Override public SetResult<Vertex> execute(Graph<Vertex, Edge> graph) { return new SetResult<>(emptyIfFalse(graph.containsVertex(END_VERTEX), () -> graph.edgesOf(END_VERTEX).stream().map(Edge::getTarget))); } ChangesOperation(); }
ChangesOperation extends AbstractGraphOperation<SetResult<Vertex>> { @Override public SetResult<Vertex> execute(Graph<Vertex, Edge> graph) { return new SetResult<>(emptyIfFalse(graph.containsVertex(END_VERTEX), () -> graph.edgesOf(END_VERTEX).stream().map(Edge::getTarget))); } ChangesOperation(); @Override SetResult<Vertex> execute(Graph<Vertex, Edge> graph); }
ChangesOperation extends AbstractGraphOperation<SetResult<Vertex>> { @Override public SetResult<Vertex> execute(Graph<Vertex, Edge> graph) { return new SetResult<>(emptyIfFalse(graph.containsVertex(END_VERTEX), () -> graph.edgesOf(END_VERTEX).stream().map(Edge::getTarget))); } ChangesOperation(); @Override SetResult<Vertex> execute(Graph<Vertex, Edge> graph);  }