code: public static <Item extends IItem> void findSubItemSelections(Item item, List<String> selections) {
          if (item instanceof IExpandable && !((IExpandable) item).isExpanded() && ((IExpandable) item).getSubItems() != null) {
              List<Item> subItems = (List<Item>) ((IExpandable<Item, ?>) item).getSubItems();
              for (int i = 0, size = subItems.size(); i < size; i++) {
                  Item subItem = subItems.get(i);
                  String id = String.valueOf(subItem.getIdentifier());
                  if (subItem.isSelected()) {
                      selections.add(id);
                  }
                  findSubItemSelections(subItem, selections);
              }
          }
      }
docs: internal method to find all selections from subItems and sub sub items so we can save those inside our savedInstanceState
  
  @param item       the parent item
  @param selections the ArrayList which will be stored in the savedInstanceState