### Question:
CategoryFilterFactory implements FilterFactory { public Filter createFilter(FilterFactoryParams params) throws FilterNotCreatedException { try { return createFilter(parseCategories(params.getArgs())); } catch (ClassNotFoundException e) { throw new FilterNotCreatedException(e); } }  Filter createFilter(FilterFactoryParams params);  }### Answer:
@Test public void shouldCreateFilter() throws Exception { FilterFactoryParams params = new FilterFactoryParams( createSuiteDescription(testName.getMethodName()), CategoryFilterFactoryStub.class.getName()); Filter filter = categoryFilterFactory.createFilter(params); assertThat(filter, instanceOf(DummyFilter.class)); }
@Test public void shouldThrowException() throws Exception { FilterFactoryParams params = new FilterFactoryParams( createSuiteDescription(testName.getMethodName()), "NonExistentFilter"); expectedException.expect(FilterFactory.FilterNotCreatedException.class); categoryFilterFactory.createFilter(params); }