@Override
    public void check(Object argument) {
        Preconditions.checkNotNull(argument, "Argument %s of %s must not be null", idx, parent);
        Preconditions.checkArgument(argument instanceof OperatorNode, "Argument %s of %s must be an OperatorNode<%s> (is %s).", idx, parent, operatorType.getName(), argument.getClass());
        OperatorNode<?> node = (OperatorNode<?>) argument;
        Operator op = node.getOperator();
        Preconditions.checkArgument(operatorType.isInstance(op), "Argument %s of %s must be an OperatorNode<%s> (is: %s).", idx, parent, operatorType.getName(), op.getClass());
        if (!operators.isEmpty()) {
            Preconditions.checkArgument(operators.contains(op), "Argument %s of %s must be %s (is %s).", idx, parent, Joiner.on("|").join(operators), op);
        }
    }
Check that an argument is an OperatorNode of a particular operator set.
container-search/src/main/java/com/yahoo/search/yql/NodeTypeChecker.java