code: public static int numPoints(Clustering<? extends MeanModel> clustering) {
      int n = 0;
      for(Cluster<? extends MeanModel> aCluster : clustering.getAllClusters()) {
        n += aCluster.size();
      }
      return n;
    }
docs: Compute the number of points in a given set of clusters (which may be
  <i>less</i> than the complete data set for X-means!)
  
  @param clustering Clustering to analyze
  @return Number of points