class InstanceOfExprContext extends AbstractJavaParserContext<InstanceOfExpr> {

    public InstanceOfExprContext(InstanceOfExpr wrappedNode, TypeSolver typeSolver) {
        super(wrappedNode, typeSolver);
    }

    @Override
    public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name) {
        Optional<PatternExpr> optionalPatternExpr = wrappedNode.getPattern();
        if(optionalPatternExpr.isPresent()) {
            if(optionalPatternExpr.get().getNameAsString().equals(name)) {
                JavaParserPatternDeclaration decl = JavaParserSymbolDeclaration.patternVar(optionalPatternExpr.get(), typeSolver);
                return SymbolReference.solved(decl);
            }
        }


        Optional<Context> optionalParentContext = getParent();
        if (!optionalParentContext.isPresent()) {
            return SymbolReference.unsolved();
        }

        Context parentContext = optionalParentContext.get();
        if(parentContext instanceof BinaryExprContext) {
            Optional<PatternExpr> optionalPatternExpr1 = parentContext.patternExprInScope(name);
            if(optionalPatternExpr1.isPresent()) {
                JavaParserPatternDeclaration decl = JavaParserSymbolDeclaration.patternVar(optionalPatternExpr1.get(), typeSolver);
                return SymbolReference.solved(decl);
            }
        } // TODO: Also consider unary expr context


        // if nothing is found we should ask the parent context
        return solveSymbolInParentContext(name);
    }

    @Override
    public List<PatternExpr> patternExprsExposedFromChildren() {<FILL_FUNCTION_BODY>}



}

        List<PatternExpr> results = new ArrayList<>();

        // If this instanceof expression has a pattern, add it to the list.
        wrappedNode.getPattern().ifPresent(results::add);

        return results;
    
<methods>public void <init>(com.github.javaparser.ast.expr.InstanceOfExpr, com.github.javaparser.resolution.TypeSolver) ,public boolean equals(java.lang.Object) ,public final Optional<com.github.javaparser.resolution.Context> getParent() ,public com.github.javaparser.ast.expr.InstanceOfExpr getWrappedNode() ,public int hashCode() ,public Optional<com.github.javaparser.resolution.MethodUsage> solveMethodAsUsage(java.lang.String, List<com.github.javaparser.resolution.types.ResolvedType>) ,public SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbolInParentContext(java.lang.String) ,public static SymbolReference<com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveWith(com.github.javaparser.resolution.SymbolDeclarator, java.lang.String) <variables>protected com.github.javaparser.resolution.TypeSolver typeSolver,protected com.github.javaparser.ast.expr.InstanceOfExpr wrappedNode