private Item buildEquals(String key, Inspector value) {
        Map<Integer, Inspector> children = childMap(value);
        if ( children.size() != 2)
            throw new IllegalArgumentException("The value of 'equals' should be an array containing a field name and " +
                                               "a value, but was " + value);
        if ( children.get(0).type() != STRING)
            throw new IllegalArgumentException("The first array element under 'equals' should be a field name string " +
                                               "but was " + children.get(0));
        String field = children.get(0).asString();
        return switch (children.get(1).type()) {
            case BOOL -> new BoolItem(children.get(1).asBool(), field);
            case LONG -> new IntItem(children.get(1).asLong(), field);
            default ->
                    throw new IllegalArgumentException("The second array element under 'equals' should be a boolean " +
                                                       "or int value but was " + children.get(1));
        };
    }
Translates a list of grouping requests on JSON form to a list in the grouping language form
container-search/src/main/java/com/yahoo/search/query/SelectParser.java