mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
testdata for IDEA-126109
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Test {
|
||||
void foo(final Stream<Person> stream) {
|
||||
final Map<String,List<Person>> mapByFirstLetter = stream.collect(Collectors.groupingBy(p -> "" + p.name.charAt(0)));
|
||||
|
||||
final String vV = mapByFirstLetter.values().stream().map(lp -> lp.stream().map(p -> p.name)
|
||||
.collect(Collectors.joining("/","<",">"))) .collect(Collectors.joining(" : "));
|
||||
|
||||
final String vV2 = mapByFirstLetter.values().stream()
|
||||
.map(lp -> lp.stream().map(Person::getName).collect(Collectors.joining("/","<",">")))
|
||||
.collect(Collectors.joining(" : "));
|
||||
System.out.println("mapByFirstLetter2 : "+ vV2);
|
||||
}
|
||||
|
||||
public static class Person {
|
||||
private String name;
|
||||
public Person(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getName() {return name;}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user