List<ConfigurationErrorDescription> () { List<ConfigurationErrorDescription> items = new ArrayList<>(); for (Map.Entry<JCheckBox, ConfigurationErrorDescription> entry : myCheckboxes.entrySet()) { if (entry.getKey().isSelected()) { items.add(entry.getValue()); } } return items; }