Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaComparator comparing thenComparingSingle-choice MCQ

Which behavior accurately describes thenComparing when the primary comparator reports two elements as equal but they are distinct objects?

Comparator<String> byLen = Comparator.comparingInt(String::length); Comparator<String> c = byLen.thenComparing(s -> s);