void (@NotNull List<LoadingOrder.Orderable> list) { try { LoadingOrder.Companion.sortByLoadingOrder(list); fail("Should have failed"); } catch (SortingException e) { LoadingOrder.Orderable[] conflictingElements = e.getConflictingElements(); assertEquals(2, conflictingElements.length); assertEquals("bad", ((MyOrderable)conflictingElements[0]).getName()); assertEquals("bad", ((MyOrderable)conflictingElements[1]).getName()); } }