public IterationResult<T> iterate(UUID cursorId, int maxCount) {
        UUID iteratorId = cursorToIteratorId.get(cursorId);
        if (iteratorId == null) {
            throw new IllegalStateException("There is no iteration with cursor id " + cursorId + " on member "
                    + this.nodeEngine.getThisAddress() + ".");
        }
        IteratorWithCursor<T> paginator = iterators.get(iteratorId);
        if (paginator == null) {
            throw new IllegalStateException("There is no iteration with cursor id " + cursorId + " on member "
                    + this.nodeEngine.getThisAddress() + ".");
        }
        IterationResult<T> result = paginator.iterate(cursorId, maxCount);
        if (result.getCursorIdToForget() != null) {
            // Remove the previous cursor id.
            cursorToIteratorId.remove(result.getCursorIdToForget());
        }
        // Put the new cursor id.
        cursorToIteratorId.put(result.getCursorId(), iteratorId);
        return result;
    }
@Test
    public void testIteration() throws InterruptedException {
        ExecutorService executor = newFixedThreadPool(THREAD_COUNT);

        CountDownLatch latch = new CountDownLatch(THREAD_COUNT);
        for (int i = 0; i < THREAD_COUNT; i++) {
            final int j = i;
            executor.execute(() -> {
                iterate(j);
                latch.countDown();
            });
        }
        latch.await();

        executor.shutdown();
    }