List<AnAction> () { List<AnAction> result = new ArrayList<>(); List<AnAction> secondary = new ArrayList<>(); AnAction[] kids = myActionGroup.getChildren(null); for (AnAction each : kids) { if (myActionGroup.isPrimary(each)) { result.add(each); } else { secondary.add(each); } } result.add(new Separator()); result.addAll(secondary); return result; }