code: protected boolean checkSortKeyInBufferRange(BaseRow sortKey, TopNBuffer buffer) {
  		Comparator<BaseRow> comparator = buffer.getSortKeyComparator();
  		Map.Entry<BaseRow, Collection<BaseRow>> worstEntry = buffer.lastEntry();
  		if (worstEntry == null) {
  			// return true if the buffer is empty.
  			return true;
  		} else {
  			BaseRow worstKey = worstEntry.getKey();
  			int compare = comparator.compare(sortKey, worstKey);
  			if (compare < 0) {
  				return true;
  			} else {
  				return buffer.getCurrentTopNum() < getDefaultTopNSize();
  			}
  		}
  	}
docs: Checks whether the record should be put into the buffer.
  
  @param sortKey sortKey to test
  @param buffer buffer to add
  @return true if the record should be put into the buffer.