boolean passOptional(char character) {
            int localPosition = position;
            while (localPosition < s.length()) {
                char nextChar = s.charAt(localPosition++);
                if (!Character.isSpaceChar(nextChar)) {
                    if (nextChar == character) {
                        position = localPosition;
                        return true;
                    } else {
                        return false;
                    }
                }
            }
            return false;
        }
Checks if the next non-space character is the given and moves the position past it if so.
Does not change the position otherwise.

@return true if the next non-space character was the given character
container-search/src/main/java/com/yahoo/search/yql/ParameterListParser.java