public static int indexOfWhiteSpace(CharSequence seq, int offset) {
        for (; offset < seq.length(); ++offset) {
            if (Character.isWhitespace(seq.charAt(offset))) {
                return offset;
            }
        }
        return -1;
    }
@Test
    public void testIndexOfWhiteSpace() {
        assertEquals(-1, indexOfWhiteSpace("", 0));
        assertEquals(0, indexOfWhiteSpace(" ", 0));
        assertEquals(-1, indexOfWhiteSpace(" ", 1));
        assertEquals(0, indexOfWhiteSpace("\n", 0));
        assertEquals(-1, indexOfWhiteSpace("\n", 1));
        assertEquals(0, indexOfWhiteSpace("\t", 0));
        assertEquals(-1, indexOfWhiteSpace("\t", 1));
        assertEquals(3, indexOfWhiteSpace("foo\r\nbar", 1));
        assertEquals(-1, indexOfWhiteSpace("foo\r\nbar", 10));
        assertEquals(7, indexOfWhiteSpace("foo\tbar\r\n", 6));
        assertEquals(-1, indexOfWhiteSpace("foo\tbar\r\n", Integer.MAX_VALUE));
    }