docs: public static List<Pair<Double,Integer>> queryAllWithDistances(INDArray toQuery,INDArray X,List<RPTree> trees,int n,String similarityFunction) {
          if(trees.isEmpty()) {
              throw new ND4JIllegalArgumentException("Trees is empty!");
          }
  
          List<Integer> candidates = getCandidates(toQuery, trees,similarityFunction);
          val sortedCandidates = sortCandidates(toQuery,X,candidates,similarityFunction);
          int numReturns = Math.min(n,sortedCandidates.size());
          List<Pair<Double,Integer>> ret = new ArrayList<>(numReturns);
          for(int i = 0; i < numReturns; i++) {
              ret.add(sortedCandidates.get(i));
          }
  
          return ret;
      }