StringUtils { public static boolean isNullOrWhiteSpace(String input) { return input == null || input.trim().length() == 0; } private  StringUtils(); static boolean isNullOrWhiteSpace(String input); static String[] trimAllElements(String[] elements); static String EmptyString; }
@Test public void testIsNullOrWhiteSpace() throws Exception { Assert.assertTrue(StringUtils.isNullOrWhiteSpace(null)); Assert.assertTrue(StringUtils.isNullOrWhiteSpace("")); Assert.assertTrue(StringUtils.isNullOrWhiteSpace(" ")); Assert.assertFalse(StringUtils.isNullOrWhiteSpace("a")); }