private void removeTaskContents(Project project, Object sessionId) {
    if (project.isDisposed()) {
      return;
    }
    final ContentManager contentManager = MessageView.getInstance(project).getContentManager();
    for (Content content : contentManager.getContents()) {
      if (!content.isPinned()) {
        if (CONTENT_ID_KEY.get(content) == myContentId || SESSION_ID_KEY.get(content) == sessionId) {
          contentManager.removeContent(content, true);
        }
      }
    }
  }
private void removeTaskContents(Project project, Object sessionId)