### Question:
AnnotationTokenStream extends TokenStream { public void reset() { featureStructureIterator = null; currentAnnotation = null; featureFormats = Collections.emptyMap(); initializeIterators(); } AnnotationTokenStream(JCas jCas, String sofaName, String typeName);  AnnotationTokenStream(JCas jCas, String sofaName, String typeName,
			String featureName, Format featureFormat);  AnnotationTokenStream(JCas jCas, String sofaName, String typeName,
			List<String> featureNames, String delimiter,
			Map<String, Format> featureFormats);  AnnotationTokenStream(JCas jCas, String sofaName, String typeName,
			List<String> featureNames, Map<String, Format> featureFormats);  AnnotationTokenStream(JCas jCas, String sofaName, String typeName,
			String featurePath, List<String> featureNames,
			Map<String, Format> featureFormats);  AnnotationTokenStream(JCas jCas, String sofaName, String typeName,
			String featurePath, List<String> featureNames, String delimiter,
			Map<String, Format> featureFormats); @Override Token next(Token token); @Override Token next(); String getValueForFeature(FeatureStructure featureStructure,
			Feature feature, Format format); void reset(); Map<String, Format> getFeatureFormats(); JCas getJCas(); String getFeaturePath(); List<String> getFeatureNames(); String getDelimiter(); Type getAnnotationType();  }### Answer:
@Test public void testReset() throws Exception{ JCas cas = createCasWithText("token1 token2 token3"); Annotation1 annotation1 = new Annotation1(cas); annotation1.setBegin(0); annotation1.setEnd(6); annotation1.addToIndexes(); Annotation1 annotation2 = new Annotation1(cas); annotation2.setBegin(7); annotation2.setEnd(13); annotation2.addToIndexes(); Annotation1 annotation3 = new Annotation1(cas); annotation3.setBegin(14); annotation3.setEnd(20); annotation3.addToIndexes(); AnnotationTokenStream annotationTokenStream = new AnnotationTokenStream(cas, CAS.NAME_DEFAULT_SOFA, "org.apache.uima.lucas.indexer.types.test.Annotation1"); Token nextToken = annotationTokenStream.next(); nextToken = annotationTokenStream.next(); nextToken = annotationTokenStream.next(); annotationTokenStream.reset(); nextToken = annotationTokenStream.next(); assertNotNull(nextToken); assertEquals("token1", new String(nextToken.termBuffer(), 0, nextToken.termLength())); assertEquals(0, nextToken.startOffset()); assertEquals(6, nextToken.endOffset()); nextToken = annotationTokenStream.next(); assertNotNull(nextToken); assertEquals("token2", new String(nextToken.termBuffer(), 0, nextToken.termLength())); assertEquals(7, nextToken.startOffset()); assertEquals(13, nextToken.endOffset()); nextToken = annotationTokenStream.next(); assertNotNull(nextToken); assertEquals("token3", new String(nextToken.termBuffer(), 0, nextToken.termLength())); assertEquals(14, nextToken.startOffset()); assertEquals(20, nextToken.endOffset()); }