docs: public static INDArray queryAll(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());
  
          INDArray result = Nd4j.create(numReturns);
          for(int i = 0; i < numReturns; i++) {
              result.putScalar(i,sortedCandidates.get(i).getSecond());
          }
  
  
          return result;
      }