public synchronized ShareSession get(ShareSessionKey key) {
        return sessions.getOrDefault(key, null);
    }
Get a session by session key.

@param key The share session key.
@return The session, or None if no such session was found.
server/src/main/java/org/apache/kafka/server/share/ShareSessionCache.java