### Question:
SimpleCommonRulesRewriterFactory extends RewriterFactory { @Override public QueryRewriter createRewriter(final ExpandedQuery input, final SearchEngineRequestAdapter searchEngineRequestAdapter) { final SelectionStrategy selectionStrategy = searchEngineRequestAdapter .getRequestParam(strategyParam) .map(name -> { final SelectionStrategyFactory factory = selectionStrategyFactories.get(name); if (factory == null) { throw new IllegalArgumentException("No selection strategy for name " + name); } return factory; }).orElse(defaultSelectionStrategyFactory) .createSelectionStrategy(getRewriterId(), searchEngineRequestAdapter); return new CommonRulesRewriter(rules, selectionStrategy); } SimpleCommonRulesRewriterFactory(final String rewriterId,
                                            final Reader reader, final QuerqyParserFactory querqyParserFactory,
                                            final boolean ignoreCase,
                                            final Map<String, SelectionStrategyFactory> selectionStrategyFactories,
                                            final SelectionStrategyFactory defaultSelectionStrategyFactory); @Override QueryRewriter createRewriter(final ExpandedQuery input,
                                        final SearchEngineRequestAdapter searchEngineRequestAdapter); @Override Set<Term> getGenerableTerms();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testCreateRewriterDoesNotAcceptUnknownStrategyName() throws IOException { when(requestAdapter.getRequestParam(any())).thenReturn(Optional.of(STRATEGY_NAME1 + "void")); final SimpleCommonRulesRewriterFactory factory = new SimpleCommonRulesRewriterFactory("someId", new StringReader("input =>\n DECORATE: deco1"), querqyParserFactory, true, namedStrategyFactories, defaultSelectionStrategyFactory); factory.createRewriter(query, requestAdapter); }