class ApplicationNameUtil {

    public String decorateName(String name, String userName) {
        if (name.endsWith("-cb")) {
            name += "-" + userName;
        }
        if (!name.endsWith("-cb-" + userName)) {
            name = name + "-cb-" + userName;
        }
        return cutToMaxLength(name, userName);
    }

}