code: public int getExpandedItemsCount(int from, int position) {
          int totalAddedItems = 0;
          //first we find out how many items were added in total
          //also counting subItems
          Item tmp;
          for (int i = from; i < position; i++) {
              tmp = mFastAdapter.getItem(i);
              if (tmp instanceof IExpandable) {
                  IExpandable tmpExpandable = ((IExpandable) tmp);
                  if (tmpExpandable.getSubItems() != null && tmpExpandable.isExpanded()) {
                      totalAddedItems = totalAddedItems + tmpExpandable.getSubItems().size();
                  }
              }
          }
          return totalAddedItems;
      }
docs: calculates the count of expandable items before a given position
  
  @param from     the global start position you should pass here the count of items of the previous adapters (or 0 if you want to start from the beginning)
  @param position the global position
  @return the count of expandable items before a given position