List<AnAction> () { List<AnAction> actions = new ArrayList<>(); for (Sorter sorter : myTreeModel.getSorters()) { if (sorter.isVisible()) { actions.add(new MyTreeActionWrapper(sorter)); } } return actions; }