IDEA-160637 test fixed

This commit is contained in:
Tagir Valeev
2016-09-02 14:47:07 +07:00
parent 1a1290751c
commit 6bd88cf67f
2 changed files with 6 additions and 7 deletions
@@ -7,7 +7,6 @@ import java.util.stream.Collectors;
public class Main {
public void test(List<Set<String>> nested) {
List<String> result = nested.stream().filter(element -> element != null).flatMap(Collection::stream)
.filter(str -> str.startsWith("xyz")).map(String::trim).collect(Collectors.toList());
List<String> result = nested.stream().filter(element -> element != null).flatMap(Collection::stream).filter(str -> str.startsWith("xyz")).map(String::trim).collect(Collectors.toList());
}
}
@@ -6,10 +6,10 @@ import java.util.Map;
public class Main {
public void test(Map<String, String[]> map) {
List<String> result = new ArrayList<>();
map.entrySet().stream().filter(entry -> entry.getKey().startsWith("x")).map(Map.Entry::getValue).forEach(arr -> {
for (String str : arr) {
result.add(str.trim() + arr.length);
}
});
map.entrySet().stream().filter(entry -> entry.getKey().startsWith("x")).map(Map.Entry::getValue).forEach(arr -> {
for (String str : arr) {
result.add(str.trim() + arr.length);
}
});
}
}