code: public static <T extends IItem & IExpandable> int countSelectedSubItems(final FastAdapter adapter, T header) {
          SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
          if (extension != null) {
              Set<IItem> selections = extension.getSelectedItems();
              return countSelectedSubItems(selections, header);
          }
          return 0;
      }
docs: counts the selected items in the adapter underneath an expandable item, recursively
  
  @param adapter the adapter instance
  @param header  the header who's selected children should be counted
  @return number of selected items underneath the header