(@Size(max=100) List<@From(CalendarGenerator.class) GregorianCalendar> cals)
| 24 | } |
| 25 | |
| 26 | @Fuzz |
| 27 | public void testCompare(@Size(max=100) List<@From(CalendarGenerator.class) GregorianCalendar> cals) { |
| 28 | // Sort list of calendar objects using our custom comparator function |
| 29 | Collections.sort(cals, CalendarLogic::compare); |
| 30 | |
| 31 | // If they have an ordering, then the sort should succeed |
| 32 | for (int i = 1; i < cals.size(); i++) { |
| 33 | Calendar c1 = cals.get(i-1); |
| 34 | Calendar c2 = cals.get(i); |
| 35 | assumeFalse(c1.equals(c2)); // Assume that we have distinct dates |
| 36 | assertTrue(c1 + " should be before " + c2, c1.before(c2)); // Then c1 < c2 |
| 37 | } |
| 38 | } |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected