### Question:
StringUtil { public static boolean ifNotBlank(final String text, final Consumer<String> consumer) { if (StringUtils.isNotBlank(text)) { consumer.accept(text); return true; } return false; } private  StringUtil(); static String removeTrailingChar(final String original, final char charToRemove); static synchronized String defaultFormatDatetime(final Date date); static synchronized String defaultFileFormatTimestamp(final Date date); static String replaceToken(final String original, final String token, final Object replacement); static String replace(final String originalPattern, final String newPattern, final String originalString); static String replaceToken(final String original, final String token, final String replacement); static String replaceCRToken(final String original); static String wrapText(final String inString, final String newline, final int wrapColumn); static String trimAndUpperCase(final String str); static String toLowerCase(final String str); static String toUpperCase(final String str); static String processCaseTreatment(final String str, final CaseTreatment caseTreatment); static String toString(final Object object); static String toStringOrEmpty(final Object object); static String singleQuote(final String text); static boolean isNotBlank(final Object text); static boolean ifNotBlank(final String text, final Consumer<String> consumer); static boolean noneBlank(final String... text); static boolean allEquals(final String value, final String... strings); static boolean equalsAnyIgnoreCase(final String val, final String... strings); static boolean equalsAnyIgnoreCase(final String val, final String toCheck); static String concat(final Object... osToString); static String concatWithSpaces(final Object... osToString); @Deprecated static String emptyIfNull(final Object obj); static boolean isWildcardOrNull(final String txt); static String returnIfNotNull(final String txt, final String defaultTxt); static String firstCharToUpper(final String txt); static String trim(final String str); static String prepareForNumericParsing(final String inputStr); static String nullIfEmpty(final String txt); static int compareTo(final String s1, final String s2); static String asList(final String[] values, final String separator); static String boxify(final char boxing, final String text); static boolean anyEmpty(final String... strings); static boolean equalsIgnoreCaseOrValueIsWildcard(final String value, final String toCheck); static final String NEW_LINE; static final String SINGLE_QUOTE; static final String SLASH; static final String NULL_COL; static final String COMMA; static final String DOT; static final String SPACE; static final String EMPTY; static final String WILDCARD; static final StandardToStringStyle STYLE; static final String OPEN_PARENTHESES; static final String CLOSE_PARENTHESES; }### Answer:
@Test public void testIfNotBlank() { assertThat(StringUtil.ifNotBlank(null, (t) -> fail("null should not have been called"))).isFalse(); assertThat(StringUtil.ifNotBlank("", (t) -> fail("Empty should not have been called"))).isFalse(); assertThat(StringUtil.ifNotBlank("Hello", new Consumer<String>() { @Override public void accept(String t) { } })).isTrue(); }