CharacterUtils { public static boolean isWhitespace(char c) { return c <= 32 || Character.isWhitespace(c) || c == NO_BREAK_SPACE; } private  CharacterUtils(); static boolean isWhitespace(char c); static int getIndex(char[] characters, char character); static char[] mergeArrays(char[]... arrays); static char[] arrayOf(char... characters); static boolean belongsTo(char character, char[]... characters); static boolean belongsTo(char character, char... characters); static final char[] DIGITS; static final char[] LETTERS; static final char[] LITERALS; static final char TAB; static final char BACKSPACE; static final char NO_BREAK_SPACE; }
@Test void testIsWhitespace() { Assertions.assertAll( () -> Assertions.assertTrue(CharacterUtils.isWhitespace(' ')), () -> Assertions.assertFalse(CharacterUtils.isWhitespace('a')), () -> Assertions.assertTrue(CharacterUtils.isWhitespace((char) 0)), () -> Assertions.assertTrue(CharacterUtils.isWhitespace(CharacterUtils.TAB)), () -> Assertions.assertTrue(CharacterUtils.isWhitespace(CharacterUtils.NO_BREAK_SPACE)) ); }