code: public static int estimatedSizeOf(Collection<QueryableEntry> result) {
          if (result instanceof AndResultSet) {
              return ((AndResultSet) result).estimatedSize();
          } else if (result instanceof OrResultSet) {
              return ((OrResultSet) result).estimatedSize();
          }
          return result.size();
      }
docs: In case of AndResultSet and OrResultSet calling size() may be very
  expensive so quicker estimatedSize() is used.
  
  @param result result of a predicated search
  @return size or estimated size
  @see AndResultSet#estimatedSize()
  @see OrResultSet#estimatedSize()