StringUtil { public static boolean isNullOrEmpty(@Nullable String s) { return s == null || s.trim().length() == 0; }  static boolean isNullOrEmpty(@Nullable String s); @NonNull static String controlToSpace(@Nullable String val); static boolean isValid(@Nullable String value); static final char SPACE_CHAR; }
@Test public void isNullOrEmpty_ShouldReturnTrueIfNull() { boolean result = StringUtil.isNullOrEmpty(null); assertTrue(result); }
@Test public void isNullOrEmpty_ShouldReturnTrueIfEmpty() { boolean result = StringUtil.isNullOrEmpty(""); assertTrue(result); }
@Test public void isNullOrEmpty_ShouldReturnTrueIfOnlySpaces() { boolean result = StringUtil.isNullOrEmpty(" "); assertTrue(result); }
@Test public void isNullOrEmpty_ShouldReturnFalseIfNotEmpty() { boolean result = StringUtil.isNullOrEmpty(" hello "); assertFalse(result); }