code: public static int countItems(final IItemAdapter adapter, IPredicate predicate) {
          return countItems(adapter.getAdapterItems(), true, false, predicate);
      }
docs: counts the items in the adapter, respecting subitems regardless of there current visibility
  
  @param adapter   the adapter instance
  @param predicate predicate against which each item will be checked before counting it
  @return number of items in the adapter that apply to the predicate