class VarType extends Type {
	
	private static final String JAVA_LANG_OBJECT = Object.class.getCanonicalName();

    @AllFieldsConstructor
    public VarType() {
        this(null);
    }

    /**
     * This constructor is used by the parser and is considered private.
     */
    @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
    public VarType(TokenRange tokenRange) {
        super(tokenRange);
        customInitialization();
    }

    @Override
    public VarType setAnnotations(NodeList<AnnotationExpr> annotations) {
        return (VarType) super.setAnnotations(annotations);
    }

    @Override
    public String asString() {
        return "var";
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
    public VarType clone() {
        return (VarType) accept(new CloneVisitor(), null);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
    public VarTypeMetaModel getMetaModel() {
        return JavaParserMetaModel.varTypeMetaModel;
    }

    @Override
    public ResolvedType resolve() {
        return getSymbolResolver().toResolvedType(this, ResolvedType.class);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
        return v.visit(this, arg);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <A> void accept(final VoidVisitor<A> v, final A arg) {
        v.visit(this, arg);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isVarType() {
        return true;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public VarType asVarType() {
        return this;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<VarType> toVarType() {
        return Optional.of(this);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifVarType(Consumer<VarType> action) {
        action.accept(this);
    }

	@Override
	public ResolvedType convertToUsage(Context context) {<FILL_FUNCTION_BODY>}
	
	private Optional<ForEachStmt> forEachStmtWithVariableDeclarator(
            VariableDeclarator variableDeclarator) {
        Optional<Node> node = variableDeclarator.getParentNode();
        if (!node.isPresent() || !(node.get() instanceof VariableDeclarationExpr)) {
            return Optional.empty();
        }
        node = node.get().getParentNode();
        if (!node.isPresent() || !(node.get() instanceof ForEachStmt)) {
            return Optional.empty();
        }
        return Optional.of((ForEachStmt)node.get());
    }
}

		Node parent = getParentNode().get();
        if (!(parent instanceof VariableDeclarator)) {
            throw new IllegalStateException("Trying to resolve a `var` which is not in a variable declaration.");
        }
        final VariableDeclarator variableDeclarator = (VariableDeclarator) parent;
        Optional<Expression> initializer = variableDeclarator.getInitializer();
        if (!initializer.isPresent()) {
            // When a `var` type decl has no initializer it may be part of a
            // for-each statement (e.g. `for(var i : expr)`).
            Optional<ForEachStmt> forEachStmt = forEachStmtWithVariableDeclarator(variableDeclarator);
            if (forEachStmt.isPresent()) {
                Expression iterable = forEachStmt.get().getIterable();
                ResolvedType iterType = iterable.calculateResolvedType();
                if (iterType instanceof ResolvedArrayType) {
                    // The type of a variable in a for-each loop with an array
                    // is the component type of the array.
                    return ((ResolvedArrayType)iterType).getComponentType();
                }
                if (iterType.isReferenceType()) {
                    // The type of a variable in a for-each loop with an
                    // Iterable with parameter type
                	List<ResolvedType> parametersType = iterType.asReferenceType().typeParametersMap().getTypes();
					if (parametersType.isEmpty()) {
						Optional<ResolvedTypeDeclaration> oObjectDeclaration = context.solveType(JAVA_LANG_OBJECT)
								.getDeclaration();
						return oObjectDeclaration
								.map(decl -> ReferenceTypeImpl.undeterminedParameters(decl.asReferenceType()))
								.orElseThrow(() -> new UnsupportedOperationException());
					}
                    return parametersType.get(0);
                }
            }
        }
        return initializer
                .map(Expression::calculateResolvedType)
                .orElseThrow(() -> new IllegalStateException("Cannot resolve `var` which has no initializer."));
	
<methods>public void <init>(NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public void <init>(com.github.javaparser.TokenRange, NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public com.github.javaparser.ast.type.ArrayType asArrayType() ,public com.github.javaparser.ast.type.ClassOrInterfaceType asClassOrInterfaceType() ,public com.github.javaparser.ast.type.IntersectionType asIntersectionType() ,public com.github.javaparser.ast.type.PrimitiveType asPrimitiveType() ,public com.github.javaparser.ast.type.ReferenceType asReferenceType() ,public abstract java.lang.String asString() ,public com.github.javaparser.ast.type.TypeParameter asTypeParameter() ,public com.github.javaparser.ast.type.UnionType asUnionType() ,public com.github.javaparser.ast.type.UnknownType asUnknownType() ,public com.github.javaparser.ast.type.VarType asVarType() ,public com.github.javaparser.ast.type.VoidType asVoidType() ,public com.github.javaparser.ast.type.WildcardType asWildcardType() ,public com.github.javaparser.ast.type.Type clone() ,public com.github.javaparser.ast.expr.AnnotationExpr getAnnotation(int) ,public NodeList<com.github.javaparser.ast.expr.AnnotationExpr> getAnnotations() ,public int getArrayLevel() ,public com.github.javaparser.ast.type.Type getElementType() ,public com.github.javaparser.metamodel.TypeMetaModel getMetaModel() ,public void ifArrayType(Consumer<com.github.javaparser.ast.type.ArrayType>) ,public void ifClassOrInterfaceType(Consumer<com.github.javaparser.ast.type.ClassOrInterfaceType>) ,public void ifIntersectionType(Consumer<com.github.javaparser.ast.type.IntersectionType>) ,public void ifPrimitiveType(Consumer<com.github.javaparser.ast.type.PrimitiveType>) ,public void ifReferenceType(Consumer<com.github.javaparser.ast.type.ReferenceType>) ,public void ifTypeParameter(Consumer<com.github.javaparser.ast.type.TypeParameter>) ,public void ifUnionType(Consumer<com.github.javaparser.ast.type.UnionType>) ,public void ifUnknownType(Consumer<com.github.javaparser.ast.type.UnknownType>) ,public void ifVarType(Consumer<com.github.javaparser.ast.type.VarType>) ,public void ifVoidType(Consumer<com.github.javaparser.ast.type.VoidType>) ,public void ifWildcardType(Consumer<com.github.javaparser.ast.type.WildcardType>) ,public boolean isArrayType() ,public boolean isClassOrInterfaceType() ,public boolean isIntersectionType() ,public boolean isPrimitiveType() ,public boolean isReferenceType() ,public boolean isTypeParameter() ,public boolean isUnionType() ,public boolean isUnknownType() ,public boolean isVarType() ,public boolean isVoidType() ,public boolean isWildcardType() ,public boolean remove(com.github.javaparser.ast.Node) ,public boolean replace(com.github.javaparser.ast.Node, com.github.javaparser.ast.Node) ,public abstract com.github.javaparser.resolution.types.ResolvedType resolve() ,public com.github.javaparser.ast.type.Type setAnnotations(NodeList<com.github.javaparser.ast.expr.AnnotationExpr>) ,public Optional<com.github.javaparser.ast.type.ArrayType> toArrayType() ,public Optional<com.github.javaparser.ast.type.ClassOrInterfaceType> toClassOrInterfaceType() ,public java.lang.String toDescriptor() ,public Optional<com.github.javaparser.ast.type.IntersectionType> toIntersectionType() ,public Optional<com.github.javaparser.ast.type.PrimitiveType> toPrimitiveType() ,public Optional<com.github.javaparser.ast.type.ReferenceType> toReferenceType() ,public Optional<com.github.javaparser.ast.type.TypeParameter> toTypeParameter() ,public Optional<com.github.javaparser.ast.type.UnionType> toUnionType() ,public Optional<com.github.javaparser.ast.type.UnknownType> toUnknownType() ,public Optional<com.github.javaparser.ast.type.VarType> toVarType() ,public Optional<com.github.javaparser.ast.type.VoidType> toVoidType() ,public Optional<com.github.javaparser.ast.type.WildcardType> toWildcardType() <variables>private NodeList<com.github.javaparser.ast.expr.AnnotationExpr> annotations