ExcludedWordsFilter implements WordFilter { @Override public boolean isShown(final AnalysisWord word) { Set<String> exclusions = exclusions(); String identifier = CoreTool.toLowerCase(word.getWordIdentifier()); return !exclusions.contains(identifier); } ExcludedWordsFilter(final Executor executor, final List<Supplier<Collection<String>>> excludedWordsSuppliers); @Override boolean isShown(final AnalysisWord word);  }
@Test public void testAsyncException() { WordFilter filter = new FilterBuilder() .executor(executorService) .addExcludedWordsSupplier(this::throwException) .build(); try { filter.isShown(word("test")); fail("No exception thrown"); } catch (final VocabHunterException e) { assertEquals(ERROR_MESSAGE, e.getMessage()); } }