diff --git a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java index b31e4be9dc578..dec8d563e0c19 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java @@ -405,7 +405,7 @@ public void ensureNoWarnings() { // unit tests do not run with the bundled JDK, if there are warnings we need to filter the no-jdk deprecation warning final List filteredWarnings = warnings .stream() - .filter(k -> filteredWarnings().stream().anyMatch(s -> s.contains(k))) + .filter(k -> filteredWarnings().stream().anyMatch(s -> s.contains(k) == false)) .collect(Collectors.toList()); assertThat("unexpected warning headers", filteredWarnings, empty()); } else {