class DefaultRolesAuthorizationGenerator implements AuthorizationGenerator {

    private Collection<String> defaultRoles;

    /**
     * <p>Constructor for DefaultRolesAuthorizationGenerator.</p>
     */
    public DefaultRolesAuthorizationGenerator() {}

    /**
     * <p>Constructor for DefaultRolesAuthorizationGenerator.</p>
     *
     * @param defaultRoles a {@link Collection} object
     */
    public DefaultRolesAuthorizationGenerator(final Collection<String> defaultRoles) {
        this.defaultRoles = defaultRoles;
    }

    /**
     * <p>Constructor for DefaultRolesAuthorizationGenerator.</p>
     *
     * @param defaultRoles an array of {@link String} objects
     */
    public DefaultRolesAuthorizationGenerator(final String[] defaultRoles) {
        if (defaultRoles != null) {
            this.defaultRoles = Arrays.asList(defaultRoles);
        } else {
            this.defaultRoles = null;
        }
    }

    /** {@inheritDoc} */
    @Override
    public Optional<UserProfile> generate(final CallContext ctx, final UserProfile profile) {<FILL_FUNCTION_BODY>}

    /**
     * Setter for defaultRoles
     *
     * @param defaultRolesStr a coma-separated string of role names
     */
    public void setDefaultRoles(final String defaultRolesStr) {
        this.defaultRoles = Arrays.asList(defaultRolesStr.split(","));
    }
}

        if (defaultRoles != null) {
            profile.addRoles(defaultRoles);
        }
        return Optional.of(profile);
    
<no_super_class>