Collection.isEmpty() should be used to test for emptiness
Closes gh-1670
This commit is contained in:
committed by
Stephane Nicoll
parent
7da40abba5
commit
e381514b07
@@ -151,7 +151,7 @@ abstract class BootstrapUtils {
|
||||
@Nullable
|
||||
private static Class<?> resolveExplicitTestContextBootstrapper(Class<?> testClass) {
|
||||
Set<BootstrapWith> annotations = AnnotatedElementUtils.findAllMergedAnnotations(testClass, BootstrapWith.class);
|
||||
if (annotations.size() < 1) {
|
||||
if (annotations.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Assert.state(annotations.size() <= 1, () -> String.format(
|
||||
|
||||
@@ -201,7 +201,7 @@ public abstract class ModelAndViewAssert {
|
||||
tempSet.addAll(incorrectSet);
|
||||
tempSet.removeAll(assertionSet);
|
||||
|
||||
if (tempSet.size() > 0) {
|
||||
if (!tempSet.isEmpty()) {
|
||||
sb.append("Set has too many elements:\n");
|
||||
for (Object element : tempSet) {
|
||||
sb.append('-');
|
||||
@@ -214,7 +214,7 @@ public abstract class ModelAndViewAssert {
|
||||
tempSet.addAll(assertionSet);
|
||||
tempSet.removeAll(incorrectSet);
|
||||
|
||||
if (tempSet.size() > 0) {
|
||||
if (!tempSet.isEmpty()) {
|
||||
sb.append("Set is missing elements:\n");
|
||||
for (Object element : tempSet) {
|
||||
sb.append('-');
|
||||
|
||||
Reference in New Issue
Block a user