void (@NotNull MyFileTypeItem currItem, boolean isSelected) { if (currItem.isGroupItem()) { myItems.stream() .filter(subItem -> subItem.mySuperType == currItem.myFileType) .forEach(subItem -> subItem.setSelected(isSelected)); } else if (currItem.mySuperType != null) { for (MyFileTypeItem item : myItems) { if (item.myFileType == currItem.mySuperType) { item.setState(getSuperItemState(currItem)); break; } } } }