docs: @Override
    public DoubleDBIDList reverseKNNQuery(DBIDRef id, int k) {
      if (k > this.getKmax()) {
        throw new IllegalArgumentException("Parameter k has to be equal or less than " + "parameter k of the MkMax-Tree!");
      }
  
      // get the candidates
      ModifiableDoubleDBIDList candidates = DBIDUtil.newDistanceDBIDList();
      doReverseKNNQuery(id, getRoot(), null, candidates);
  
      if (k == this.getKmax()) {
        candidates.sort();
        // FIXME: re-add statistics.
        // rkNNStatistics.addTrueHits(candidates.size());
        // rkNNStatistics.addResults(candidates.size());
        return candidates;
      }
  
      // refinement of candidates
      ModifiableDBIDs candidateIDs = DBIDUtil.newArray(candidates.size());
      for (DBIDIter candidate = candidates.iter(); candidate.valid(); candidate.advance()) {
        candidateIDs.add(candidate);
      }
      Map<DBID, KNNList> knnLists = batchNN(getRoot(), candidateIDs, k);
  
      ModifiableDoubleDBIDList result = DBIDUtil.newDistanceDBIDList();
      for (DBIDIter iter = candidateIDs.iter(); iter.valid(); iter.advance()) {
        DBID cid = DBIDUtil.deref(iter);
        KNNList cands = knnLists.get(cid);
        for (DoubleDBIDListIter iter2 = cands.iter(); iter2.valid(); iter2.advance()) {
          if (DBIDUtil.equal(id, iter2)) {
            result.add(iter2.doubleValue(), cid);
            break;
          }
        }
      }
  
      // FIXME: re-add statistics.
      // rkNNStatistics.addResults(result.size());
      // rkNNStatistics.addCandidates(candidates.size());
      result.sort();
      return result;
    }