@ParameterizedTest @ArgumentsSource(TestCaseArgumentsProvider.class) @TestCase({"1", "2", "3", "1"}) @TestCase({"null", "2", "3", "2"}) @TestCase({"null", "null", "3", "3"}) @TestCase({"null", "null", "null", "null"}) @TestCase({"1", "null", "3", "1"}) @TestCase({"1", "null", "null", "1"}) @TestCase({"1", "2", "null", "1"}) @TestCase({"null", "2", "null", "2"}) @TestCase({"null", "2", "3", "2"}) @TestCase({"null", "null", "3", "3"}) void coalesce3(Integer a, Integer b, Integer c, Integer expected) { Integer result = ObjectUtil.coalesce(a, b, c); 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);  }