List<AnAction> (@NotNull List<? extends AnAction> actions1, @NotNull Collection<? extends AnAction> actions2) { return ContainerUtil.map(actions1, action1 -> { final AnAction action2 = ContainerUtil.find(actions2, action -> action1.getClass() == action.getClass() && StringUtil.equals(action1.getTemplatePresentation().getText(), action.getTemplatePresentation().getText())); if (action2 instanceof ToggleUseSoftWrapsToolbarAction) { return new MergedWrapTextAction(((ToggleUseSoftWrapsToolbarAction)action1), (ToggleUseSoftWrapsToolbarAction)action2); } else if (action2 instanceof ScrollToTheEndToolbarAction) { return new MergedToggleAction(((ToggleAction)action1), (ToggleAction)action2); } else if (action2 instanceof ClearConsoleAction) { return new MergedAction(action1, action2); } else { return action1; } }); }