### Question:
DefaultOrderComparator implements OrderComparator<T> { @Override public List<T> compare(List<T> list) { return compare(list, true); }  @Override List<T> compare(List<T> list); @Override List<T> compare(List<T> list, final boolean asc);  }### Answer:
@DisplayName("test_compare_Asc") @Test void testCompareAsc() { List<Class> list = new ArrayList<>(); list.add(Order2.class); list.add(Order1.class); list = comparator.compare(list); assertEquals(Order1.class, list.get(0)); assertEquals(Order2.class, list.get(1)); }
@DisplayName("test_compare_Desc") @Test void testCompareDesc() { List<Class> list = new ArrayList<>(); list.add(Order1.class); list.add(Order2.class); list = comparator.compare(list, false); assertEquals(Order2.class, list.get(0)); assertEquals(Order1.class, list.get(1)); }
@DisplayName("test_compare_NotOrder") @Test void testCompareNotOrder() { List<Class> list = new ArrayList<>(); list.add(Order1.class); list.add(NoOrder1.class); try { comparator.compare(list); fail(); } catch (IllegalArgumentException e) { assertEquals("Class io.github.ukuz.piccolo.api.common.DefaultOrderComparatorTest$NoOrder1 doesn't annotated with @Order", e.getMessage()); } }