private static Set<String> writeMethods(TreeLogger logger,
            GeneratorContext context, JClassType type, SourceWriter writer)
            throws UnableToCompleteException {
        Set<String> allUsedSelectionProperties = new HashSet<String>();

        JMethod[] methods = type.getMethods();
        for (JMethod method : methods) {
            if (method.isStatic()) {
                logger.log(Type.DEBUG,
                        "Ignoring static method " + method.getName());
                continue;
            }

            if (!method.isPublic()) {
                logger.log(Type.DEBUG,
                        "Ignoring non-public method " + method.getName());
                continue;
            }

            Set<String> usedSeletionProperties = writeMethod(
                    logger.branch(
                            Type.DEBUG,
                            "Processing method "
                                    + method.getReadableDeclaration()),
                    context, method, writer);
            if (usedSeletionProperties != null) {
                allUsedSelectionProperties.addAll(usedSeletionProperties);
            }
        }

        return allUsedSelectionProperties;
    }