class SingleNodeTypeValidator<N extends Node> implements Validator {

    private final Class<N> type;

    private final TypedValidator<N> validator;

    public SingleNodeTypeValidator(Class<N> type, TypedValidator<N> validator) {
        this.type = type;
        this.validator = validator;
    }

    @Override
    public void accept(Node node, ProblemReporter problemReporter) {<FILL_FUNCTION_BODY>}
}

        if (type.isInstance(node)) {
            validator.accept(type.cast(node), problemReporter);
        }
        node.findAll(type).forEach(n -> validator.accept(n, problemReporter));
    
<no_super_class>