ArrayList<AnAction> (final boolean fromPopup) { final ArrayList<AnAction> result = new ArrayList<>(); AbstractAddGroup addAction = createAddAction(fromPopup); if (addAction != null) { result.add(addAction); } result.add(new MyRemoveAction()); final List<? extends AnAction> copyActions = createCopyActions(fromPopup); result.addAll(copyActions); result.add(Separator.getInstance()); if (fromPopup) { result.add(new MyFindUsagesAction(myTree)); } return result; }