Modify givenTwoObjects_whenUsingGoogleGuavaMoreObjects_thenReturnFirstNonNull() unit test to have two extra local variables for readability

This commit is contained in:
danielmcnally285 2023-11-05 12:06:33 +00:00
parent 88a92d399c
commit 8f01f45455
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ public class ReturnFirstNonNullUnitTest {
@Test @Test
public void givenTwoObjects_whenUsingGoogleGuavaMoreObjects_thenReturnFirstNonNull() { 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); assertEquals("first non null", object);
} }