code: public static List<Integer> getCandidates(INDArray x,List<RPTree> roots,String similarityFunction) {
          Set<Integer> ret = new LinkedHashSet<>();
          for(RPTree tree : roots) {
              RPNode root = tree.getRoot();
              RPNode query = query(root,tree.getRpHyperPlanes(),x,similarityFunction);
              ret.addAll(query.getIndices());
          }
  
          return new ArrayList<>(ret);
      }
docs: Get the search candidates as indices given the input
  and similarity function
  @param x the input data to search with
  @param roots the trees to search
  @param similarityFunction the function to use for similarity
  @return the list of indices as the search results