public void changeUsername(String username, Client client) {
        int clientId = client.getId();
        boolean exists = false;
        for (Client checkClient : clients) {
            if (checkClient.getUsername().equalsIgnoreCase(username)) {
                exists = true;
            }
        }

        ClientWriterThread clientWriter = clientWriterThreads.get(clientId);

        synchronized (clientWriter) {
            if (exists) {
                logger.info("SERVER:Username " + username + " already exists ! User : " + client.getId());
                clientWriter.sendMessage("/username;error");
                clientWriter.sendMessage("SERVER:Username " + username + " already exists !");
            } else {
                clientWriter.sendMessage("/username;ok");
                logger.info("SERVER:Username change for : " + username + " : user " + client.getId());
                clientWriter.sendMessage("SERVER:Username change for : " + username + " : user " + client.getId());
                client.setUsername(username);
            }
        }
    }