void (@NotNull Collection<? extends Module> modules) { List<@NotNull Item> items = ContainerUtil.sorted(ContainerUtil.map(modules, Item::new), Comparator.comparing(o -> o.myModule.getName())); CollectionComboBoxModel<Item> model = new ModelWithOptions(); model.add(items); if (myNoModule != null) { model.add((Item)null); } if (myOptionItems.length > 0) { model.add(mySeparator); } model.add(Arrays.asList(myOptionItems)); setModel(model); }