SortUtil { public static Order order(final SortOrder order, final String columnName) { if (SortOrder.DESC.equals(order)) { return Order.desc(columnName); } return Order.asc(columnName); } private  SortUtil(); static Order order(final SortOrder order, final String columnName);  }
@Test public void testOrder() { Order order = SortUtil.order(SortOrder.ASC, "foo"); assertEquals("foo", order.getPropertyName()); assertEquals(true, order.isAscending()); Order order2 = SortUtil.order(SortOrder.DESC, "bar"); assertEquals("bar", order2.getPropertyName()); assertEquals(false, order2.isAscending()); }