code: @Override
      public int predict(double[] x) {
          if (centroids == null) {
              throw new IllegalStateException("Call partition() first!");
          }
          
          Leaf leaf = root.search(x);
          return leaf.y;
      }
docs: Cluster a new instance to the nearest CF leaf. After building the
  CF tree, the user should call {@link #partition(int)} method first
  to clustering leaves. Then they call this method to clustering new
  data.
  
  @param x a new instance.
  @return the cluster label, which is the label of nearest CF leaf.
  Note that it may be {@link #OUTLIER}.