### Question:
Filters { public List<Filter<?>> asList() { return filters; } Filters(final Map<String, String> filters, final FilterCreator filterCreator);  Filters(final Map<String, String> filters); List<Filter<?>> asList();  }### Answer:
@Test public void testFiltersListWithoutFilterCreator() throws Exception { when(fiedConverter.convert("field")) .thenReturn("field"); Filters filters = new Filters(aMapWith(new Arg("field", "value")), new GenericFilterCreator(fiedConverter)); List<Filter<?>> filterList = filters.asList(); Assert.assertEquals("field", filterList.get(0).getField()); Assert.assertEquals("value", filterList.get(0).getValue()); }
@Test public void testFilterListWithMultiTypeFilterCreator() throws Exception { Map<String, String> map = aMapWith(new Arg("field1", "value"), new Arg("field2", "value")); doReturn(longFilter).when(filterCreator).create(eq("field1"), anyString()); doReturn(strFilter).when(filterCreator).create(eq("field2"), anyString()); Filters filters = new Filters(map, filterCreator); assertTrue(IsRightValue(filters.asList().get(0))); assertTrue(IsRightValue(filters.asList().get(1))); }