@Override
    public boolean removeClientRoute(JID route)
    {
        if (route.getResource() == null) {
            throw new IllegalArgumentException("For removing a client route, the argument 'route' must be a full JID, but was " + route);
        }

        Log.debug("Removing client route {}", route);
        final DomainPair domainPair = new DomainPair("", route.toFullJID());

        boolean sessionRemoved;
        final Lock lock = usersSessionsCache.getLock(route.toBareJID());
        lock.lock();
        try {
            ClientRoute clientRoute = usersCache.remove(route.toFullJID());
            if (clientRoute != null) {
                Log.trace("Removed client route {} from users cache under key {}", route, clientRoute);
            }
            sessionRemoved = clientRoute != null;

            if (usersSessionsCache.containsKey(route.toBareJID())) {
                // The user session still needs to be removed
                Log.trace("Removing client full JID {} from users sessions cache under key {}", route.toFullJID(), route.toBareJID());
                // Acquires the same lock, which should not be an issue as the lock implementation (both Openfire's and Hazelcast's) is reentrant.
                if (CacheUtil.removeValueFromMultiValuedCache(usersSessionsCache, route.toBareJID(), route.toFullJID())) {
                    sessionRemoved = true;
                }

                if (clientRoute == null && sessionRemoved) {
                    Log.warn("Client route not found for route {}, while user session still existed. This is indicative of a data inconsistency, which is likely a bug in Openfire.", route);
                }
            }

            Log.trace("Removing client route {} from local routing table", route);
            localClientRoutingTable.removeRoute(domainPair);
        } finally {
            lock.unlock();
        }

        return sessionRemoved;
    }
Gets the non-negative session from a minimal priority.

@param sessions The sessions.
@param min      The minimal priority.
@return The filtered sessions.
xmppserver/src/main/java/org/jivesoftware/openfire/spi/RoutingTableImpl.java