IDEA-162051 Simplify !Stream.anyMatch(x -> !(...)) to Stream.allMatch() and so on

This commit is contained in:
Tagir Valeev
2016-10-04 17:16:59 +07:00
parent c14b15bf66
commit 50e727cbf4
16 changed files with 256 additions and 4 deletions
@@ -0,0 +1,10 @@
// "Replace Stream.allMatch(x -> !(...)) with Stream.noneMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).noneMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.allMatch(x -> !(...)) with Stream.anyMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).anyMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.anyMatch(...) with Stream.noneMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).noneMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.anyMatch(x -> !(...)) with Stream.allMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).allMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.noneMatch(...) with Stream.anyMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).anyMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace Stream.noneMatch(x -> !(...)) with Stream.allMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).allMatch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace Stream.allMatch(x -> !(...)) with Stream.noneMatch(...)" "false"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(!data.stream().flatMap(Collection::stream).allM<caret>atch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace Stream.allMatch(x -> !(...)) with Stream.noneMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).allM<caret>atch(str -> !str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.allMatch(x -> !(...)) with Stream.anyMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(!data.stream().flatMap(Collection::stream).allM<caret>atch(str -> !str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.anyMatch(...) with Stream.noneMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(!data.stream().flatMap(Collection::stream).anyM<caret>atch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.anyMatch(x -> !(...)) with Stream.allMatch(...)" "false"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).anyM<caret>atch(str -> !str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.anyMatch(x -> !(...)) with Stream.allMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(!data.stream().flatMap(Collection::stream).anyM<caret>atch(str -> !str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace !Stream.noneMatch(...) with Stream.anyMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(!data.stream().flatMap(Collection::stream).noneM<caret>atch(str -> str.isEmpty()))
return true;
}
}
@@ -0,0 +1,10 @@
// "Replace Stream.noneMatch(x -> !(...)) with Stream.allMatch(...)" "true"
import java.util.*;
class Test {
public boolean testAnyMatch(List<List<String>> data) {
if(data.stream().flatMap(Collection::stream).noneM<caret>atch(str -> !str.isEmpty()))
return true;
}
}