How to test Comparator for JUnit test?
问题 I need to test the compare() method and i am confused on how. Can I see how to do this? public class MemberComparator implements Comparator<Member> { private final String clientId; public MemberComparator(String clientId) { this.clientId = clientId; } @Override public int compare(Member m1, Member m2) { if (m1.getClientId().startsWith(clientId)) { return m2.getClientId().startsWith(clientId) ? m1.getClientId().compareTo(m2.getClientId()) : -1; } else { return m2.getClientId().startsWith