class JavaParserAdapter {

    /**
     * Wraps the {@link JavaParser}.
     *
     * @param parser The java parser to be used.
     *
     * @return The created QuickJavaParser.
     */
    public static JavaParserAdapter of(JavaParser parser) {
        return new JavaParserAdapter(parser);
    }

    private final JavaParser parser;

    public JavaParserAdapter(JavaParser parser) {
        this.parser = Objects.requireNonNull(parser, "A non-null parser should be provided.");
    }

    public JavaParser getParser() {
        return parser;
    }

    /**
     * Helper function to handle the result in a simpler way.
     *
     * @param result The result to be handled.
     *
     * @param <T> The return type.
     *
     * @return The parsed value.
     */
    private <T extends Node> T handleResult(ParseResult<T> result) {<FILL_FUNCTION_BODY>}
    
    public ParserConfiguration getParserConfiguration() {
        return parser.getParserConfiguration();
    }
    
    public CompilationUnit parse(InputStream in) {
        return handleResult(getParser().parse(in));
    }
    
    public CompilationUnit parse(File file) throws FileNotFoundException {
        return handleResult(getParser().parse(file));
    }
    
    public CompilationUnit parse(Path path) throws IOException {
        return handleResult(getParser().parse(path));
    }
    
    public CompilationUnit parse(Reader reader) {
        return handleResult(getParser().parse(reader));
    }
    
    public CompilationUnit parse(String code) {
        return handleResult(getParser().parse(code));
    }
    
    public CompilationUnit parseResource(String path) throws IOException {
        return handleResult(getParser().parseResource(path));
    }
    
    public BlockStmt parseBlock(String blockStatement) {
        return handleResult(getParser().parseBlock(blockStatement));
    }
    
    public Statement parseStatement(String statement) {
        return handleResult(getParser().parseStatement(statement));
    }
    
    public ImportDeclaration parseImport(String importDeclaration) {
        return handleResult(getParser().parseImport(importDeclaration));
    }
    
    public <T extends Expression> T parseExpression(String expression) {
        return handleResult(getParser().parseExpression(expression));
    }
    
    public AnnotationExpr parseAnnotation(String annotation) {
        return handleResult(getParser().parseAnnotation(annotation));
    }
    
    public BodyDeclaration<?> parseAnnotationBodyDeclaration(String body) {
        return handleResult(getParser().parseAnnotationBodyDeclaration(body));
    }
    
    public BodyDeclaration<?> parseBodyDeclaration(String body) {
        return handleResult(getParser().parseBodyDeclaration(body));
    }
    
    public ClassOrInterfaceType parseClassOrInterfaceType(String type) {
        return handleResult(getParser().parseClassOrInterfaceType(type));
    }
    
    public Type parseType(String type) {
        return handleResult(getParser().parseType(type));
    }
    
    public VariableDeclarationExpr parseVariableDeclarationExpr(String declaration) {
        return handleResult(getParser().parseVariableDeclarationExpr(declaration));
    }
    
    public Javadoc parseJavadoc(String content) {
        return JavadocParser.parse(content);
    }
    
    public ExplicitConstructorInvocationStmt parseExplicitConstructorInvocationStmt(String statement) {
        return handleResult(getParser().parseExplicitConstructorInvocationStmt(statement));
    }

    public Name parseName(String qualifiedName) {
        return handleResult(getParser().parseName(qualifiedName));
    }
    
    public SimpleName parseSimpleName(String name) {
        return handleResult(getParser().parseSimpleName(name));
    }

    public Parameter parseParameter(String parameter) {
        return handleResult(getParser().parseParameter(parameter));
    }
    
    public PackageDeclaration parsePackageDeclaration(String packageDeclaration) {
        return handleResult(getParser().parsePackageDeclaration(packageDeclaration));
    }
    
    public TypeDeclaration<?> parseTypeDeclaration(String typeDeclaration) {
        return handleResult(getParser().parseTypeDeclaration(typeDeclaration));
    }

    public ModuleDeclaration parseModuleDeclaration(String moduleDeclaration) {
        return handleResult(getParser().parseModuleDeclaration(moduleDeclaration));
    }

    public ModuleDirective parseModuleDirective(String moduleDirective) {
        return handleResult(getParser().parseModuleDirective(moduleDirective));
    }

    public TypeParameter parseTypeParameter(String typeParameter) {
        return handleResult(getParser().parseTypeParameter(typeParameter));
    }
    
    public MethodDeclaration parseMethodDeclaration(String methodDeclaration) {
        return handleResult(getParser().parseMethodDeclaration(methodDeclaration));
    }

    public ArrayInitializerExpr parseArrayInitializerExpr(String arrayInitializerExpr) {
        return handleResult(getParser().parseArrayInitializerExpr(arrayInitializerExpr));
    }
}

        if (result.isSuccessful()) {
            return result.getResult().orElse(null);
        }

        throw new ParseProblemException(result.getProblems());
    
<no_super_class>