@ParameterizedTest @ArgumentsSource(TestCaseArgumentsProvider.class) @TestCase({"null", "null", "null"}) @TestCase({"null", "B", "B"}) @TestCase({"A", "B", "A"}) @TestCase({"A", "null", "A"}) void coalesce2(String a, String b, String expected) { String result = ObjectUtil.coalesce(a, b); assertThat(result, is(expected)); }
public static <T> T coalesce(T item1, T item2) { return item1 != null ? item1 : item2; }
ObjectUtil extends UtilityClass { public static <T> T coalesce(T item1, T item2) { return item1 != null ? item1 : item2; } }
ObjectUtil extends UtilityClass { public static <T> T coalesce(T item1, T item2) { return item1 != null ? item1 : item2; }  }
ObjectUtil extends UtilityClass { public static <T> T coalesce(T item1, T item2) { return item1 != null ? item1 : item2; }  static T coalesce(T item1, T item2); static T coalesce(T item1, T item2, T item3); static T coalesce(T item1, T item2, T item3, T item4); @SafeVarargs static T coalesce(T... items); }
ObjectUtil extends UtilityClass { public static <T> T coalesce(T item1, T item2) { return item1 != null ? item1 : item2; }  static T coalesce(T item1, T item2); static T coalesce(T item1, T item2, T item3); static T coalesce(T item1, T item2, T item3, T item4); @SafeVarargs static T coalesce(T... items);  }