StringUtils { @Nullable public static String emptyToNull(@Nullable final String s) { return ((s != null) && s.isEmpty()) ? null : s; } private  StringUtils(); @Nonnull static String nullToEmpty(@Nullable final String s); @Nullable static String emptyToNull(@Nullable final String s); @Nullable static String trim(@Nullable final String s); @Nullable static List<String> trim(@Nullable final List<String> sList); @Nullable static Set<String> trim(@Nullable final Set<String> sSet); @Nullable static String literalToLowerCase(@Nullable final String s); @Nonnull static int[] toCodePoints(@Nonnull final String s); @Nonnull static String mkString(@Nonnull final String separator, @Nonnull final Collection<?> values); @Nonnull static String mkRevString(@Nonnull final String separator, @Nonnull final Collection<T> values); @SafeVarargs @Nonnull static String mkString(@Nonnull final String separator, @Nonnull final T... values); @SafeVarargs @Nonnull static String mkRevString(@Nonnull final String separator, @Nonnull final T... values); @Nonnull static String generateRandomStringFromChars(@Nonnull final char[] chars, final int length); @SuppressWarnings("ConstantConditions") @Nonnull static String encodeToJsonString(@Nonnull final String input); @Nullable static String decodeFromJsonString(@Nonnull final String input);  }
@Test public void testEmptyToNull() { LOG.info("testEmptyToNull"); Assert.assertNull(StringUtils.emptyToNull(null)); Assert.assertNull(StringUtils.emptyToNull("")); final String input = "a"; Assert.assertEquals(input, StringUtils.emptyToNull(input)); }