From 8f01f4545564109b63595f2f3aaa490d6f70e4b5 Mon Sep 17 00:00:00 2001 From: danielmcnally285 <144589379+danielmcnally285@users.noreply.github.com> Date: Sun, 5 Nov 2023 12:06:33 +0000 Subject: [PATCH] Modify givenTwoObjects_whenUsingGoogleGuavaMoreObjects_thenReturnFirstNonNull() unit test to have two extra local variables for readability --- .../returnfirstnonnull/ReturnFirstNonNullUnitTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core-java-modules/core-java-lang-6/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullUnitTest.java b/core-java-modules/core-java-lang-6/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullUnitTest.java index 19b25d3265..f99a8cb419 100644 --- a/core-java-modules/core-java-lang-6/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullUnitTest.java +++ b/core-java-modules/core-java-lang-6/src/test/java/com/baeldung/returnfirstnonnull/ReturnFirstNonNullUnitTest.java @@ -72,7 +72,9 @@ public class ReturnFirstNonNullUnitTest { @Test public void givenTwoObjects_whenUsingGoogleGuavaMoreObjects_thenReturnFirstNonNull() { - String object = MoreObjects.firstNonNull(null, "first non null"); + String nullObject = null; + String nonNullObject = "first non null"; + String object = MoreObjects.firstNonNull(nullObject, nonNullObject); assertEquals("first non null", object); }