StringUtil { public static String nullIfEmpty(final String string) { return null != string && string.isEmpty() ? null : string; } private  StringUtil(); static String toString(final byte[] bytes); static byte[] toBytes(final String string); static String escapeComma(final String str); static String unescapeComma(final String escapedStr); static byte[] toCsv(final Class<?>... classes); static Set<Class<? extends T>> csvToClasses(final byte[] bytes, final Class<? extends T> clazz); static String nullIfEmpty(final String string); static final char COMMA; }
@Test public void ifEmptyStringTestReturnNull() { assertNull(StringUtil.nullIfEmpty("")); }