public static Speaker findSpeakerWithLongestName() {
return speakers
.stream()
.max(Comparator.comparing(Speaker::getName))
.orElseThrow(NoSuchElementException::new);
}
quality education for all
public static Speaker findSpeakerWithLongestName() {
return speakers
.stream()
.max(Comparator.comparing(Speaker::getName))
.orElseThrow(NoSuchElementException::new);
}