### Question:
SortField extends AbstractConstruct { protected <T extends Model> Order getOrder(CriteriaBuilder builder, Root<T> root) { Path<?> path = getPath(root, name); return asc ? builder.asc(path) : builder.desc(path); }    }### Answer:
@Test public void shouldGetAscOrder() { SortField sortField = new SortField("field1", true); assertEquals(sortField.getOrder(builder, root), order1); }
@Test public void shouldGetDescOrder() { SortField sortField = new SortField("field1", false); assertEquals(sortField.getOrder(builder, root), order2); }