StringUtil { public static boolean isEmpty(String str) { return str == null || str.length() == 0; }  static boolean isEmpty(String str); static boolean isNotEmpty(String str); static void setIfPresent(String value, Consumer<String> setter); static String join(final char delimiter, final String... strings); static boolean substringMatch(CharSequence str, int index, CharSequence substring); static String cut(String str, int threshold); static String trim(final String str, final char ch);  }
@Test public void testIsEmpty() { Assert.assertTrue(StringUtil.isEmpty(null)); Assert.assertTrue(StringUtil.isEmpty("")); Assert.assertFalse(StringUtil.isEmpty(" ")); Assert.assertFalse(StringUtil.isEmpty("A String")); }