StringUtilities { public static boolean isEmpty(final String value) { return value == null || value.length() == 0; } private  StringUtilities(); static String generateRandom(); static String generateRandom(final int length); static String urlEncode(final String text); static String urlDecode(final String text); static boolean isEmpty(final String value);  }
@Test public void shouldDetectEmptyStrings() { assertThat(StringUtilities.isEmpty(null), is(true)); assertThat(StringUtilities.isEmpty(""), is(true)); assertThat(StringUtilities.isEmpty(" "), is(false)); assertThat(StringUtilities.isEmpty("a"), is(false)); }