From 09fa8e366a8abbf685a5b051adb6ec84c2834b02 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 20 Jan 2020 19:42:30 +0100 Subject: [PATCH] Use Objects.equals() Co-Authored-By: Marc Philipp --- .../main/java/org/junit/jupiter/api/AssertIterableEquals.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java index 10dfa911d10..13d04d9f407 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java @@ -69,7 +69,7 @@ private static void assertIterableEquals(Iterable expected, Iterable actua } // Prevent stack overflow error. // See https://github.com/junit-team/junit5/issues/2157 for details. - if (expectedElement != null && expectedElement.equals(actualElement)) { + if (Objects.equals(expectedElement, actualElement)) { continue; }