List<AnAction> (AnAction[] actionsToFilter, Collection<AnAction> mainActions) { HashSet<AnAction> visited = new HashSet<>(mainActions); return filter(actionsToFilter, action -> action instanceof Separator || !visited.contains(action)); }