### Question:
Biocreative2GeneCollectionReader extends
        JCasCollectionReader_ImplBase { public void getNext(JCas jcas) throws IOException, CollectionException { String article = articleIt.next(); int firstSpace = article.indexOf(" "); String articleId = article.substring(0, firstSpace); String articleText = article.substring(firstSpace + 1); jcas.setDocumentText(articleText); Header header = new Header(jcas); header.setDocId(articleId); header.setComponentId(COMPONENT_ID); header.addToIndexes(); Collection<CorpusEntryDTO> collection = corpusAnnotations .get(articleId); for (CorpusEntryDTO corpusEntry : collection) { int start = articleText .indexOf(corpusEntry.text, corpusEntry.start); BioEntityMention entity = new BioEntityMention(jcas, start, start + corpusEntry.text.length()); entity.setComponentId(COMPONENT_ID); entity.addToIndexes(); assert (entity.getCoveredText().equals(corpusEntry.text)); } }  @Override void initialize(UimaContext context); void getNext(JCas jcas); boolean hasNext(); Progress[] getProgress(); static final String COMPONENT_ID; static final String INCLUDE_ALTERNATE; }### Answer:
@Test public void testTestCorpus() throws Exception { CollectionReader cr = CollectionReaderFactory.createReader( Biocreative2GeneCollectionReader.class, BlueUima.PARAM_MODE, "test"); CAS cas = CasCreationUtils .createCas(cr.getProcessingResourceMetaData()); cr.getNext(cas); Collection<BioEntityMention> genes = JCasUtil.select(cas.getJCas(), BioEntityMention.class); assertEquals(2, genes.size()); cr.close(); }