class AbstractTypeDeclaration implements ResolvedReferenceTypeDeclaration {

	/*
	 * Returns all methods which have distinct "enhanced" signature declared in this type and all members.
	 * An "enhanced" signature include the return type which is used sometimes to identify functional interfaces.
	 * This is a different implementation from the previous one which returned all methods which have a distinct
	 * signature (based on method name and qualified parameter types)
	 */
    @Override
    public final Set<MethodUsage> getAllMethods() {<FILL_FUNCTION_BODY>}

    @Override
    public final boolean isFunctionalInterface() {
        return FunctionalInterfaceLogic.getFunctionalMethod(this).isPresent();
    }

}

        Set<MethodUsage> methods = new HashSet<>();

        Set<String> methodsSignatures = new HashSet<>();

        for (ResolvedMethodDeclaration methodDeclaration : getDeclaredMethods()) {
            MethodUsage methodUsage = new MethodUsage(methodDeclaration);
            methods.add(methodUsage);
            String signature = methodUsage.getSignature();
            String returnType = methodUsage.getDeclaration().getReturnType().describe();
            String enhancedSignature = String.format("%s %s", returnType, signature);
            methodsSignatures.add(enhancedSignature);
        }

        for (ResolvedReferenceType ancestor : getAllAncestors()) {
            List<Pair<ResolvedTypeParameterDeclaration, ResolvedType>> typeParametersMap = ancestor.getTypeParametersMap();
            for (MethodUsage mu : ancestor.getDeclaredMethods()) {
                // replace type parameters to be able to filter away overridden generified methods
                MethodUsage methodUsage = mu;
                for (Pair<ResolvedTypeParameterDeclaration, ResolvedType> p : typeParametersMap) {
                    methodUsage = methodUsage.replaceTypeParameter(p.a, p.b);
                }
                String signature = methodUsage.getSignature();
                String returnType = methodUsage.getDeclaration().getReturnType().describe();
                String enhancedSignature = String.format("%s %s", returnType, signature);
                if (!methodsSignatures.contains(enhancedSignature)) {
                    methodsSignatures.add(enhancedSignature);
                    methods.add(mu);
                }
            }
        }

        return methods;
    
<no_super_class>