blob: 92d8de505e9532a3e96c4fd0dce35c8f883ba0d3 (
plain)
1
2
3
4
5
6
7
8
|
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Test {
void foo(final Stream<String> stream){
stream.collect(Collectors.toMap(s -> s, s -> s, (a, b) -> a.length() > b. length() ? a : b));
}
}
|