private static void skipToken(JsonParser parser, JsonToken... expected) throws IOException {
        JsonToken actual = parser.nextToken();
        if (Arrays.stream(expected).noneMatch(e -> e.equals(actual))) {
            throw new IllegalArgumentException(
                    String.format("Expected a token in %s, got %s (%s).",
                            Arrays.toString(expected), actual, parser.currentTokenLocation()));
        }
    }
Parses predicate query from JSON.
@param json JSON input.
@param featureHandler The handler is invoked when a feature is parsed.
@param rangeFeatureHandler The handler is invoked when a range feature is parsed.
@throws IllegalArgumentException If JSON is invalid.
predicate-search-core/src/main/java/com/yahoo/search/predicate/PredicateQueryParser.java