diff --git a/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java b/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java index 6a163747a1f..c8e706aae16 100644 --- a/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java +++ b/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java @@ -28,7 +28,6 @@ import static org.junit.Assert.fail; import com.google.common.base.Joiner; -import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.io.ByteStreams; import com.google.errorprone.DiagnosticTestHelper.LookForCheckNameInDiagnostic; @@ -52,6 +51,7 @@ import java.util.List; import java.util.Locale; import java.util.Optional; +import java.util.function.Predicate; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import javax.annotation.Nullable; diff --git a/test_helpers/src/main/java/com/google/errorprone/DiagnosticTestHelper.java b/test_helpers/src/main/java/com/google/errorprone/DiagnosticTestHelper.java index e640ec6877a..f79e9ae44db 100644 --- a/test_helpers/src/main/java/com/google/errorprone/DiagnosticTestHelper.java +++ b/test_helpers/src/main/java/com/google/errorprone/DiagnosticTestHelper.java @@ -23,7 +23,6 @@ import static org.hamcrest.Matchers.hasItem; import static org.junit.Assert.fail; -import com.google.common.base.Predicate; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import com.google.common.io.CharSource; @@ -38,6 +37,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.function.Predicate; import java.util.stream.Collectors; import javax.tools.Diagnostic; import javax.tools.DiagnosticListener; @@ -195,7 +195,7 @@ public boolean matchesSafely( return false; } - if (!matcher.apply(item.getMessage(Locale.getDefault()))) { + if (!matcher.test(item.getMessage(Locale.getDefault()))) { mismatchDescription.appendText("diagnostic does not match ").appendValue(matcher); return false; } @@ -400,7 +400,7 @@ private static class SimpleStringContains implements Predicate { } @Override - public boolean apply(String input) { + public boolean test(String input) { return input.contains(pattern); }