docs: JPopupMenu createBranchPopUpMenu() {
          JPopupMenu popupMenu = new JPopupMenu();
  
          JMenuItem filterMenuItem = MainFrameHelper.newJMenuItem("menu.filterTheseBugs", "Filter these bugs");
  
          filterMenuItem.addActionListener(evt -> {
              // TODO This code does a smarter version of filtering that is
              // only possible for branches, and does so correctly
              // However, it is still somewhat of a hack, because if we ever
              // add more tree listeners than simply the bugtreemodel,
              // They will not be called by this code. Using FilterActivity to
              // notify all listeners will however destroy any
              // benefit of using the smarter deletion method.
  
              try {
                  int startCount;
                  TreePath path = MainFrame.getInstance().getTree().getSelectionPath();
                  TreePath deletePath = path;
                  startCount = ((BugAspects) (path.getLastPathComponent())).getCount();
                  int count = ((BugAspects) (path.getParentPath().getLastPathComponent())).getCount();
                  while (count == startCount) {
                      deletePath = deletePath.getParentPath();
                      if (deletePath.getParentPath() == null)// We are at the
                          // top of the
                          // tree, don't
                          // let this be
                          // removed,
                          // rebuild tree
                          // from root.
                      {
                          Matcher m1 = mainFrame.getCurrentSelectedBugAspects().getMatcher();
                          Filter suppressionFilter1 = MainFrame.getInstance().getProject().getSuppressionFilter();
                          suppressionFilter1.addChild(m1);
                          PreferencesFrame.getInstance().updateFilterPanel();
                          FilterActivity.notifyListeners(FilterListener.Action.FILTERING, null);
                          return;
                      }
                      count = ((BugAspects) (deletePath.getParentPath().getLastPathComponent())).getCount();
                  }
                  /*
                   * deletePath should now be a path to the highest ancestor
                   * branch with the same number of elements as the branch to
                   * be deleted in other words, the branch that we actually
                   * have to remove in order to correctly remove the selected
                   * branch.
                   */
                  BugTreeModel model = MainFrame.getInstance().getBugTreeModel();
                  TreeModelEvent event = new TreeModelEvent(mainFrame, deletePath.getParentPath(),
                          new int[] { model.getIndexOfChild(deletePath.getParentPath().getLastPathComponent(),
                                  deletePath.getLastPathComponent()) }, new Object[] { deletePath.getLastPathComponent() });
                  Matcher m2 = mainFrame.getCurrentSelectedBugAspects().getMatcher();
                  Filter suppressionFilter2 = MainFrame.getInstance().getProject().getSuppressionFilter();
                  suppressionFilter2.addChild(m2);
                  PreferencesFrame.getInstance().updateFilterPanel();
                  model.sendEvent(event, BugTreeModel.TreeModification.REMOVE);
                  // FilterActivity.notifyListeners(FilterListener.Action.FILTERING,
                  // null);
  
                  mainFrame.setProjectChanged(true);
  
                  MainFrame.getInstance().getTree().setSelectionRow(0);// Selects
                  // the
                  // top
                  // of
                  // the
                  // Jtree
                  // so
                  // the
                  // CommentsArea
                  // syncs
                  // up.
              } catch (RuntimeException e) {
                  MainFrame.getInstance().showMessageDialog("Unable to create filter: " + e.getMessage());
              }
          });
  
          popupMenu.add(filterMenuItem);
  
          return popupMenu;
      }