Base64Counter counter = new Base64Counter();
String userName = user.getUserName();
JSONObject sitesObject = getSites(user);
String candidate = userName + '-' + counter.toString();
while (sitesObject.has(candidate)) {
counter.increment();
candidate = userName + '-' + counter.toString();
}
return candidate;
}