code: private void emitCurrentOrLeftover(ByteBuffer key, List<ByteBuffer> values) {
      if (leftover != null) {
        int leftOverCompare = LexicographicalComparator.compareBuffers(leftover.getKey(), key);
        if (leftOverCompare <= 0) {
          emit(leftover.getKey(), leftover.getValue());
          leftover = null;
        }
      }
      if (!values.isEmpty()) {
        emit(key, values);
        values.clear();
      }
    }
docs: Writes out the provided key and value list. If the leftover item (which was not included in the
  sort) is lower lexicographically then it is emitted first.
  
  If the values are emitted the list will be cleared. If the leftover value is emitted the
  leftover value is cleared.
  
  @param key The key being asked to be emitted. (Will not be modified)
  @param values the values associated with the key that should be emitted.