public void removeMessageFromCache(long messageId) {
        WeakReference<Message> messageRef = messages.remove(messageId);
        if (messageRef != null) {
            messageIdByRef.remove(messageRef, messageId);
        }
    }
public void removeMessageFromCache ( long messageId ) { WeakReference < Message > messageRef = messages . remove ( messageId ) ; if ( messageRef != null ) { messageIdByRef . remove ( messageRef , messageId ) ; } }
Removes a message from the cache.

@param messageId The id of the message to remove.