mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
18 lines
502 B
Java
18 lines
502 B
Java
// "Fix all 'Loop can be collapsed with Stream API' problems in file" "true"
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
class X {
|
|
void test(List<Object> list) {
|
|
List<Rect> result = list.stream().filter(o -> o instanceof Rect(
|
|
Point point1, Point(double x2, double y2) point2
|
|
) rect && x2 > point1.x()).map(o -> rect).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
record Point(double x, double y) {
|
|
}
|
|
|
|
record Rect(Point point1, Point point2) {
|
|
} |