mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
IDEA-162694 Improve "Merge filter chain" intention
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.stream.LongStream;
|
||||
|
||||
public class Main {
|
||||
void test() {
|
||||
System.out.println(LongStream.range(0, 100).anyMatch(x -> x > 20 && x < 50));
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Main {
|
||||
void test(List<String> list) {
|
||||
list.stream().filter((o) -> Objects.nonNull(o) && o.isEmpty()).forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Main {
|
||||
void test() {
|
||||
System.out.println(IntStream.range(0, 100).filter(x -> x > 20 && x < 50).count());
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
void test(List<String> list) {
|
||||
list.stream().filter(s -> s.trim().isEmpty() && s.isEmpty()).forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.stream.LongStream;
|
||||
|
||||
public class Main {
|
||||
void test() {
|
||||
System.out.println(LongStream.range(0, 100).filter(x -> x > 20).anyM<caret>atch(x -> x < 50));
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Main {
|
||||
void test(List<String> list) {
|
||||
list.stream().filter(Objects::nonNull).filt<caret>er(String::isEmpty).forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public class Main {
|
||||
void test() {
|
||||
System.out.println(IntStream.range(0, 100).filter(x -> x > 20).fil<caret>ter(x -> x < 50).count());
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Merge filter's chain" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
void test(List<String> list) {
|
||||
list.stream().filte<caret>r(s -> s.trim().isEmpty()).filter(String::isEmpty).forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user