public static int indexOfNonWhiteSpace(CharSequence seq, int offset) {
        for (; offset < seq.length(); ++offset) {
            if (!Character.isWhitespace(seq.charAt(offset))) {
                return offset;
            }
        }
        return -1;
    }
@Test
    public void testIndexOfNonWhiteSpace() {
        assertEquals(-1, indexOfNonWhiteSpace("", 0));
        assertEquals(-1, indexOfNonWhiteSpace(" ", 0));
        assertEquals(-1, indexOfNonWhiteSpace(" \t", 0));
        assertEquals(-1, indexOfNonWhiteSpace(" \t\r\n", 0));
        assertEquals(2, indexOfNonWhiteSpace(" \tfoo\r\n", 0));
        assertEquals(2, indexOfNonWhiteSpace(" \tfoo\r\n", 1));
        assertEquals(4, indexOfNonWhiteSpace(" \tfoo\r\n", 4));
        assertEquals(-1, indexOfNonWhiteSpace(" \tfoo\r\n", 10));
        assertEquals(-1, indexOfNonWhiteSpace(" \tfoo\r\n", Integer.MAX_VALUE));
    }