code: public static List<IItem> getAllItems(final IItemAdapter adapter, boolean countHeaders) {
          return getAllItems(adapter.getAdapterItems(), countHeaders, false, null);
      }
docs: retrieves a flat list of the items in the adapter, respecting subitems regardless of there current visibility
  
  @param adapter      the adapter instance
  @param countHeaders if true, headers will be counted as well
  @return list of items in the adapter