StreamToLoopInspection: handle some if/ifPresent cases

This commit is contained in:
Tagir Valeev
2016-12-13 12:33:43 +07:00
parent 1e61604d88
commit 7b65a6919d
7 changed files with 71 additions and 20 deletions
@@ -0,0 +1,14 @@
// "Replace Stream API chain with loop" "true"
import java.util.Arrays;
import java.util.List;
public class Main {
private static void test(List<String> list) {
list.stream().filter(str -> str.contains("x")).fin<caret>dFirst().ifPresent(System.out::println);
}
public static void main(String[] args) {
test(Arrays.asList("a", "b", "syz"));
}
}