@Test public void test_defaultIfEmpty() { assertThat(defaultIfEmpty("foo", "bar")).isEqualTo("foo"); assertThat(defaultIfEmpty(" ", "bar")).isEqualTo(" "); assertThat(defaultIfEmpty("", "bar")).isEqualTo("bar"); assertThat(defaultIfEmpty("", null)).isNull(); assertThat(defaultIfEmpty("", "")).isEqualTo(""); assertThat(defaultIfEmpty(null, "bar")).isEqualTo("bar"); assertThat(defaultIfEmpty(null, null)).isNull(); assertThat(defaultIfEmpty(null, "")).isEqualTo(""); }
@CheckForNull public static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue) { return isEmpty(object) ? defaultValue : object; }
OrchestratorUtils { @CheckForNull public static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue) { return isEmpty(object) ? defaultValue : object; } }
OrchestratorUtils { @CheckForNull public static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue) { return isEmpty(object) ? defaultValue : object; } private  OrchestratorUtils(); }
OrchestratorUtils { @CheckForNull public static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue) { return isEmpty(object) ? defaultValue : object; } private  OrchestratorUtils(); static void checkArgument(boolean expression, String errorMessageTemplate, @Nullable Object... errorMessageArgs); static void checkState(boolean expression, String errorMessageTemplate, @Nullable Object... errorMessageArgs); @CheckForNull static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue); @CheckForNull static T defaultIfNull(@Nullable T object, @Nullable T defaultValue); static boolean isEmpty(@Nullable String str); }
OrchestratorUtils { @CheckForNull public static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue) { return isEmpty(object) ? defaultValue : object; } private  OrchestratorUtils(); static void checkArgument(boolean expression, String errorMessageTemplate, @Nullable Object... errorMessageArgs); static void checkState(boolean expression, String errorMessageTemplate, @Nullable Object... errorMessageArgs); @CheckForNull static String defaultIfEmpty(@Nullable String object, @Nullable String defaultValue); @CheckForNull static T defaultIfNull(@Nullable T object, @Nullable T defaultValue); static boolean isEmpty(@Nullable String str);  }