### Question:
Filter { public Filter sortBy(String name, boolean asc) { return sortBy(new SortField(name, asc)); } Filter(Class<?> clazz);  Filter(int perPage, int pageNo, Condition... conditions);  Filter();  Filter(Condition... conditions); Filter condition(String name, Object value); Filter condition(String name, Operator operator, Object value); Filter page(int pageNo, int perPage); Filter sortBy(String name, boolean asc); Filter sortBy(SortField sortField); Filter cacheable(boolean cacheable); Filter clone(boolean paginate); List<T> list(); long count(); void delete();  }### Answer:
@Test public void shouldAddSortFieldsByNameAndOrder() { Filter filter = new Filter(); filter.sortBy("column1", false); assertEquals(filter.getSortFields().size(), 1); assertEquals(filter.getSortFields().get(0).getName(), "column1"); assertEquals(filter.getSortFields().get(0).isAsc(), false); }
@Test public void shouldAddSortFieldsByObject() { Filter filter = new Filter(); filter.sortBy(new SortField("column1", false)); assertEquals(filter.getSortFields().size(), 1); assertEquals(filter.getSortFields().get(0).getName(), "column1"); assertEquals(filter.getSortFields().get(0).isAsc(), false); }