RestartableSequence extends NodeSequence implements Restartable { @Override public void restart() { loadRemaining(); restartBatches(); } @SuppressWarnings( "unchecked" )  RestartableSequence( String workspaceName,
                                NodeSequence original,
                                final BufferManager bufferMgr,
                                CachedNodeSupplier nodeCache,
                                final int numRowsInMemory ); @Override int width(); @Override long getRowCount(); @Override boolean isEmpty(); @Override Batch nextBatch(); @Override void restart(); @Override void close(); @Override String toString();  }
@Test public void shouldProduceSameOrderWithOneBatchInMemory() { System.out.println("Number of rows: " + countRows(allNodes())); int numRowsInMemory = 4; int numRowsInBatch = 4; NodeSequence batches = allNodes(1.0f, numRowsInBatch); RestartableSequence restartable = new RestartableSequence(workspaceName(), batches, bufferMgr, cache, numRowsInMemory); assertSameOrder(restartable, allNodes(), false); restartable.restart(); assertSameOrder(restartable, allNodes(), true); }