@Test public void testThatDefaultIfBlankReturnsDefaultStringIfPrimaryStringIsWhitespaceOnly() { final String whitespaceOnlyPrimaryString = " "; assert !DEFAULT_STRING.equals(whitespaceOnlyPrimaryString); final String sanitizedString = StringUtils.defaultIfBlank(whitespaceOnlyPrimaryString, DEFAULT_STRING); assertEquals( "defaultIfBlank should have returned the default string", DEFAULT_STRING, sanitizedString); }
@NonNull public static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString) { return isBlank(primaryString) ? defaultString : primaryString; }
StringUtils { @NonNull public static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString) { return isBlank(primaryString) ? defaultString : primaryString; } }
StringUtils { @NonNull public static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString) { return isBlank(primaryString) ? defaultString : primaryString; } private  StringUtils(); }
StringUtils { @NonNull public static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString) { return isBlank(primaryString) ? defaultString : primaryString; } private  StringUtils(); @NonNull static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString); }
StringUtils { @NonNull public static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString) { return isBlank(primaryString) ? defaultString : primaryString; } private  StringUtils(); @NonNull static String defaultIfBlank(@Nullable final String primaryString, @NonNull final String defaultString);  }