@Test
void sortByRating() {

    final OffsetDateTime first = OffsetDateTime.ofInstant(Instant.EPOCH, Defaults.ZONE_ID);
    final OffsetDateTime second = first.plus(Duration.ofMillis(1));
    final LoanImpl l1 = mockLoan(Rating.D, 100000, first);
    final LoanImpl l2 = mockLoan(Rating.A, l1.getNonReservedRemainingInvestment()
        .getValue()
        .intValue(), second);
    final LoanDescriptor ld1 = new LoanDescriptor(l1), ld2 = new LoanDescriptor(l2);
    assertSoftly(softly -> {
        softly.assertThat(c.compare(ld1, ld2))
            .isGreaterThan(0);
        softly.assertThat(c.compare(ld2, ld1))
            .isLessThan(0);
        softly.assertThat(c.compare(ld1, ld1))
            .isEqualTo(0);
    });
}