CommonStringMethods { public static boolean isNullEmptyOrBlank(String string) { if (string == null) { return true; } return (string.trim().isEmpty()); } private  CommonStringMethods(); static boolean isNullEmptyOrBlank(String string); static String safeTrim(String string); static boolean nullSafeEquals(String a, String b);  }
@Test public void testStringIsNullEmptyOrBlank() { assertTrue(CommonStringMethods.isNullEmptyOrBlank(null)); assertTrue(CommonStringMethods.isNullEmptyOrBlank("")); assertTrue(CommonStringMethods.isNullEmptyOrBlank(" \t\r\n")); assertFalse(CommonStringMethods.isNullEmptyOrBlank("ab")); assertFalse(CommonStringMethods.isNullEmptyOrBlank(" ab ")); }