NodeStoreBenchmark { public Runnable pushStore(int nodes) { final Configuration config = new Configuration(); config.setEdgeIdType(Integer.class); config.setNodeIdType(Integer.class); final RandomGraph graph = new RandomGraph(nodes, 0, config).generate(); final NodeStore nodeStore = graph.getStore().getNodeStore(); final List<Node> nodeList = graph.getNodes(); Runnable runnable = new Runnable() { @Override public void run() { nodeStore.clear(); for (Node n : nodeList) { nodeStore.add(n); } } }; return runnable; }  Runnable iterateStore(final int nodes); Runnable resetNodeStore(final int nodes); Runnable pushStore(int nodes);  }
@Test public void testPushStore() { int[] n = {100, 1000, 10000, 100000}; for (int nodes : n) { NanoBench.create().measurements(10).measure("push node store " + nodes, new NodeStoreBenchmark().pushStore(nodes)); } }