code: Row<T>[] sortItems(final long threshold, final ErrorType errorType) {
      final ArrayList<Row<T>> rowList = new ArrayList<>();
      final ReversePurgeItemHashMap.Iterator<T> iter = hashMap.iterator();
      if (errorType == ErrorType.NO_FALSE_NEGATIVES) {
        while (iter.next()) {
          final long est = getEstimate(iter.getKey());
          final long ub = getUpperBound(iter.getKey());
          final long lb = getLowerBound(iter.getKey());
          if (ub >= threshold) {
            final Row<T> row = new Row<>(iter.getKey(), est, ub, lb);
            rowList.add(row);
          }
        }
      } else { //NO_FALSE_POSITIVES
        while (iter.next()) {
          final long est = getEstimate(iter.getKey());
          final long ub = getUpperBound(iter.getKey());
          final long lb = getLowerBound(iter.getKey());
          if (lb >= threshold) {
            final Row<T> row = new Row<>(iter.getKey(), est, ub, lb);
            rowList.add(row);
          }
        }
      }
  
      // descending order
      rowList.sort(new Comparator<Row<T>>() {
        @Override
        public int compare(final Row<T> r1, final Row<T> r2) {
          return r2.compareTo(r1);
        }
      });
  
      @SuppressWarnings("unchecked")
      final Row<T>[] rowsArr =
        rowList.toArray((Row<T>[]) Array.newInstance(Row.class, rowList.size()));
      return rowsArr;
    }
docs: End of class Row<T>