diff --git a/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullLazyEvaluateUnitTest.java b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullLazyEvaluateUnitTest.java index ae8ca09ea1..4064ec612c 100644 --- a/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullLazyEvaluateUnitTest.java +++ b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullLazyEvaluateUnitTest.java @@ -51,8 +51,8 @@ public class ReturnFirstNonNullLazyEvaluateUnitTest { } @Test - public void givenTwoObjects_whenUsingApacheCommonsLang3_thenReturnFirstNonNull() { - Object object1 = methodA(); + public void givenNullableObjectAndFallbackMethod_whenUsingApacheCommonsLang3_thenReturnFirstNonNull() { + Object object1 = null; Object object = ObjectUtils.getIfNull(object1, this::methodB); assertTrue(object != null);