code: public void removeMessageFromCache(long messageId) {
          WeakReference<Message> messageRef = messages.remove(messageId);
          if (messageRef != null) {
              messageIdByRef.remove(messageRef, messageId);
          }
      }
docs: Removes a message from the cache.
  
  @param messageId The id of the message to remove.