public void changeDefaultList(String username, PrivacyList newDefault, PrivacyList oldDefault) {
        // TODO Analyze concurrency issues when other resource may log in while doing this change
        if (oldDefault != null) {
            // Update old default list to become just another list
            oldDefault.setDefaultList(false);
            provider.updatePrivacyList(username, oldDefault);
        }
        // Update new list to become the default
        newDefault.setDefaultList(true);
        // Set new default list in the cache
        listsCache.put(getDefaultCacheKey(username), newDefault);
        // Update both lists in the database
        provider.updatePrivacyList(username, newDefault);
    }
Sets a given privacy list as the new default list of the user.

@param username the name of the user that is setting a new default list.
@param newDefault the new default privacy list.
@param oldDefault the previous privacy list or {@code null} if no default list existed.
xmppserver/src/main/java/org/jivesoftware/openfire/privacy/PrivacyListManager.java