### Question:
AsyncLabelAwareIterator implements LabelAwareIterator, Iterator<LabelledDocument> { @Override public LabelledDocument nextDocument() { return asyncIterator.next(); } AsyncLabelAwareIterator(@NonNull LabelAwareIterator iterator, int bufferSize); @Override void remove(); @Override boolean hasNextDocument(); @Override LabelledDocument nextDocument(); @Override void reset(); @Override void shutdown(); @Override LabelsSource getLabelsSource(); @Override boolean hasNext(); @Override LabelledDocument next();  }### Answer:
@Test(timeout = 300000) public void nextDocument() throws Exception { SentenceIterator sentence = new BasicLineIterator(Resources.asFile("big/raw_sentences.txt")); BasicLabelAwareIterator backed = new BasicLabelAwareIterator.Builder(sentence).build(); int cnt = 0; while (backed.hasNextDocument()) { backed.nextDocument(); cnt++; } assertEquals(97162, cnt); backed.reset(); AsyncLabelAwareIterator iterator = new AsyncLabelAwareIterator(backed, 64); cnt = 0; while (iterator.hasNext()) { iterator.next(); cnt++; if (cnt == 10) iterator.reset(); } assertEquals(97172, cnt); }