### Question:
StopwordFilterFactory implements TokenFilterFactory { public TokenFilter createTokenFilter(TokenStream tokenStream, Properties properties) throws IOException { String filePath = properties.getProperty(FILE_PATH_PARAMETER); String ignoreCase = properties.getProperty(IGRNORE_CASE_PARAMETER); ignoreCase = ignoreCase == null ? FALSE : ignoreCase; String[] stopwords = getStopwords(filePath ); return new StopFilter(tokenStream, stopwords, ignoreCase.equals(TRUE)); } StopwordFilterFactory(PlainFileReaderFactory plainFileReaderFactory); TokenFilter createTokenFilter(TokenStream tokenStream,
			Properties properties); void preloadResources(Properties properties); static final String FILE_PATH_PARAMETER; static final String IGRNORE_CASE_PARAMETER; }### Answer:
@Test public void testCreateTokenFilter() throws Exception{ expect(plainFileReaderFactory.createPlainFileReader(TEST_FILE_1)).andReturn(plainFileReader); expect(plainFileReader.readLines()).andReturn(lines); replay(plainFileReaderFactory); replay(plainFileReader); StopFilter stopFilter = (StopFilter) stopwordFilterFactory.createTokenFilter(tokenStream, properties); assertNotNull(stopFilter); verify(plainFileReaderFactory); verify(plainFileReader); reset(plainFileReaderFactory); reset(plainFileReader); replay(plainFileReaderFactory); replay(plainFileReader); stopFilter = (StopFilter) stopwordFilterFactory.createTokenFilter(tokenStream, properties); verify(plainFileReaderFactory); verify(plainFileReader); }