@Test public void testThatDefaultIfBlankReturnsPrimaryStringIfItContainsAtLeastOneNonWhitespaceCharacter() { final String primaryString = "any string containing at least one non-whitespace character"; assert !primaryString.equals(DEFAULT_STRING); final String sanitizedString = StringUtils.defaultIfBlank(primaryString, DEFAULT_STRING); assertEquals( "defaultIfBlank should have returned the primary string", primaryString, 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);  }