void (Content notToRemove, Project project, String contentName) { MessageView messageView = MessageView.getInstance(project); for (Content content : messageView.getContentManager().getContents()) { if (content.isPinned()) continue; if (contentName.equals(content.getDisplayName()) && content != notToRemove) { if (messageView.getContentManager().removeContent(content, true)) { content.release(); } } } }