class JavaParserAnonymousClassDeclaration extends AbstractClassDeclaration
        implements MethodUsageResolutionCapability {

    private final TypeSolver typeSolver;
    private final ObjectCreationExpr wrappedNode;
    private final ResolvedTypeDeclaration superTypeDeclaration;
    private final String name = "Anonymous-" + UUID.randomUUID();

    public JavaParserAnonymousClassDeclaration(ObjectCreationExpr wrappedNode,
                                               TypeSolver typeSolver) {
        this.typeSolver = typeSolver;
        this.wrappedNode = wrappedNode;

        ClassOrInterfaceType superType = wrappedNode.getType();
        String superTypeName = superType.getName().getId();
        if (superType.getScope().isPresent()) {
            superTypeName = superType.getScope().get().asString() + "." + superTypeName;
        }

        Context context = new ObjectCreationContext(wrappedNode, typeSolver);
        superTypeDeclaration = context.solveType(superTypeName).getCorrespondingDeclaration();
    }

    public ResolvedTypeDeclaration getSuperTypeDeclaration() {
        return superTypeDeclaration;
    }

    public <T extends Node> List<T> findMembersOfKind(final Class<T> memberClass) {
        if (wrappedNode.getAnonymousClassBody().isPresent()) {
            return wrappedNode
                    .getAnonymousClassBody()
                    .get()
                    .stream()
                    .filter(node -> memberClass.isAssignableFrom(node.getClass()))
                    .map(memberClass::cast)
                    .collect(Collectors.toList());
        }
        return Collections.emptyList();
    }

    public Context getContext() {
        return JavaParserFactory.getContext(wrappedNode, typeSolver);
    }

    @Override
    public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes,
                                                                  boolean staticOnly) {
        return getContext().solveMethod(name, argumentsTypes, staticOnly);
    }

    @Override
    public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentTypes,
                                                    Context invocationContext, List<ResolvedType> typeParameters) {
        return getContext().solveMethodAsUsage(name, argumentTypes);
    }

    @Override
    protected ResolvedReferenceType object() {
        return new ReferenceTypeImpl(typeSolver.getSolvedJavaLangObject());
    }

    @Override
    public Optional<ResolvedReferenceType> getSuperClass() {
        ResolvedReferenceTypeDeclaration superRRTD = superTypeDeclaration.asReferenceType();
        if (superRRTD == null) {
            return Optional.empty();
        }
        return Optional.of(new ReferenceTypeImpl(superRRTD));
    }

    @Override
    public List<ResolvedReferenceType> getInterfaces() {
        return superTypeDeclaration.asReferenceType()
                .getAncestors()
                .stream()
                .filter(type -> type.getTypeDeclaration().isPresent())
                .filter(type -> type.getTypeDeclaration().get().isInterface())
                .collect(Collectors.toList());
    }

    @Override
    public List<ResolvedConstructorDeclaration> getConstructors() {
        if (superTypeDeclaration.isInterface()) {
            return Collections.singletonList(new DefaultConstructorDeclaration<>(this));
        }
        return superTypeDeclaration.asReferenceType().getConstructors();
    }

    @Override
    public AccessSpecifier accessSpecifier() {
        return AccessSpecifier.PRIVATE;
    }

    @Override
    public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) {
        ImmutableList.Builder<ResolvedReferenceType> builder = ImmutableList.builder();

        // Only add the super type if it is present (e.g. java.lang.Object has no super class)
        getSuperClass().ifPresent(builder::add);

        // All all ancestors of the super type..?
        builder.addAll(superTypeDeclaration.asReferenceType().getAncestors(acceptIncompleteList));

        return builder.build();
    }

    @Override
    public List<ResolvedFieldDeclaration> getAllFields() {<FILL_FUNCTION_BODY>}

    @Override
    public Set<ResolvedMethodDeclaration> getDeclaredMethods() {
        return
                findMembersOfKind(MethodDeclaration.class)
                        .stream()
                        .map(method -> new JavaParserMethodDeclaration(method, typeSolver))
                        .collect(Collectors.toSet());
    }

    @Override
    public boolean isAssignableBy(ResolvedType type) {
        return false;
    }

    @Override
    public boolean isAssignableBy(ResolvedReferenceTypeDeclaration other) {
        return false;
    }

    @Override
    public boolean hasDirectlyAnnotation(String qualifiedName) {
        return false;
    }

    @Override
    public String getPackageName() {
        return AstResolutionUtils.getPackageName(wrappedNode);
    }

    @Override
    public String getClassName() {
        return AstResolutionUtils.getClassName("", wrappedNode);
    }

    @Override
    public String getQualifiedName() {
        String containerName = AstResolutionUtils.containerName(wrappedNode.getParentNode().orElse(null));
        if (containerName.isEmpty()) {
            return getName();
        }
        return containerName + "." + getName();
    }

    @Override
    public Set<ResolvedReferenceTypeDeclaration> internalTypes() {
        return
                findMembersOfKind(TypeDeclaration.class)
                        .stream()
                        .map(typeMember -> JavaParserFacade.get(typeSolver).getTypeDeclaration(typeMember))
                        .collect(Collectors.toSet());
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public List<ResolvedTypeParameterDeclaration> getTypeParameters() {
        return Lists.newArrayList();
    }

    @Override
    public Optional<ResolvedReferenceTypeDeclaration> containerType() {
        throw new UnsupportedOperationException("containerType is not supported for " + this.getClass().getCanonicalName());
    }

    @Override
    public Optional<Node> toAst() {
        return Optional.of(wrappedNode);
    }

}


        List<JavaParserFieldDeclaration> myFields = findMembersOfKind(FieldDeclaration.class)
                .stream()
                .flatMap(field -> field.getVariables()
                        .stream()
                        .map(variable -> new JavaParserFieldDeclaration(variable, typeSolver))
                )
                .collect(Collectors.toList());


        // TODO: Figure out if it is appropriate to remove the orElseThrow() -- if so, how...
        List<ResolvedFieldDeclaration> superClassFields = getSuperClass()
                .orElseThrow(() -> new RuntimeException("super class unexpectedly empty"))
                .getTypeDeclaration()
                .orElseThrow(() -> new RuntimeException("TypeDeclaration unexpectedly empty."))
                .getAllFields();

        // TODO: Figure out if it is appropriate to remove the orElseThrow() -- if so, how...
        List<ResolvedFieldDeclaration> interfaceFields =
                getInterfaces().stream()
                        .flatMap(interfaceReferenceType -> interfaceReferenceType
                                .getTypeDeclaration().orElseThrow(() -> new RuntimeException("TypeDeclaration unexpectedly empty."))
                                .getAllFields()
                                .stream()
                        )
                        .collect(Collectors.toList());

        return ImmutableList
                .<ResolvedFieldDeclaration>builder()
                .addAll(myFields)
                .addAll(superClassFields)
                .addAll(interfaceFields)
                .build();
    
<methods>public non-sealed void <init>() ,public final com.github.javaparser.resolution.declarations.ResolvedClassDeclaration asClass() ,public final List<com.github.javaparser.resolution.types.ResolvedReferenceType> getAllInterfaces() ,public final List<com.github.javaparser.resolution.types.ResolvedReferenceType> getAllSuperClasses() ,public boolean hasName() <variables>