TinkerGraph implements Graph { @Override public <C extends GraphComputer> C compute(final Class<C> graphComputerClass) { if (!graphComputerClass.equals(TinkerGraphComputer.class)) throw Graph.Exceptions.graphDoesNotSupportProvidedGraphComputer(graphComputerClass); return (C) new TinkerGraphComputer(this); } private  TinkerGraph(final Configuration configuration); static TinkerGraph open(); static TinkerGraph open(final Configuration configuration); @Override Vertex addVertex(final Object... keyValues); @Override C compute(final Class<C> graphComputerClass); @Override GraphComputer compute(); @Override Variables variables(); @Override I io(final Io.Builder<I> builder); @Override String toString(); void clear(); @Override void close(); @Override Transaction tx(); @Override Configuration configuration(); @Override Iterator<Vertex> vertices(final Object... vertexIds); @Override Iterator<Edge> edges(final Object... edgeIds); @Override Features features(); void createIndex(final String key, final Class<E> elementClass); void dropIndex(final String key, final Class<E> elementClass); Set<String> getIndexedKeys(final Class<E> elementClass); static final String GREMLIN_TINKERGRAPH_VERTEX_ID_MANAGER; static final String GREMLIN_TINKERGRAPH_EDGE_ID_MANAGER; static final String GREMLIN_TINKERGRAPH_VERTEX_PROPERTY_ID_MANAGER; static final String GREMLIN_TINKERGRAPH_DEFAULT_VERTEX_PROPERTY_CARDINALITY; static final String GREMLIN_TINKERGRAPH_GRAPH_LOCATION; static final String GREMLIN_TINKERGRAPH_GRAPH_FORMAT; static final String GREMLIN_TINKERGRAPH_ALLOW_NULL_PROPERTY_VALUES; }
@Test public void shouldOptionalUsingWithComputer() { assumeThat(Runtime.getRuntime().availableProcessors(), greaterThan(2)); final GraphTraversalSource g = TinkerFactory.createModern().traversal(); final List<Edge> expected = g.E(7, 7, 8, 9).order().by(T.id).toList(); assertEquals(expected, g.withComputer(Computer.compute().workers(3)).V(1, 2).optional(__.bothE().dedup()).order().by(T.id).toList()); assertEquals(expected, g.withComputer(Computer.compute().workers(4)).V(1, 2).optional(__.bothE().dedup()).order().by(T.id).toList()); }