void (@NotNull AnActionEvent e) { int[] indices = list.getSelectedIndices(); if (indices == null) { return; } for (int index : indices) { T item = list.getItemAt(index); if (item != null) { consumer.consume(item); } } }