@Test
void sortByRating() {

    final Loan l1 = new MockLoanBuilder()
        .set(LoanImpl::setRating, Rating.D)
        .build();
    final Loan l2 = new MockLoanBuilder()
        .set(LoanImpl::setRating, Rating.A)
        .build();
    final ParticipationDescriptor pd1 = mockParticipationDescriptor(l1),
            pd2 = mockParticipationDescriptor(l2);
    assertSoftly(softly -> {
        softly.assertThat(c.compare(pd1, pd2))
            .isGreaterThan(0);
        softly.assertThat(c.compare(pd2, pd1))
            .isLessThan(0);
        softly.assertThat(c.compare(pd1, pd1))
            .isEqualTo(0);
    });
}