void () { OSFileAssociationPreferences preferences = OSFileAssociationPreferences.getInstance(); myItems.forEach( item -> { boolean selected = preferences.contains(item.myFileType); item.setSelected(selected); onItemStateChange(item, selected); } ); }