code: public List<Set<Integer>> clusters() {
          List<Set<Integer>> clusters = new ArrayList<Set<Integer>>();
          for (int c = 0; c < numClusters; ++c)
              clusters.add(new HashSet<Integer>());
          for (int i = 0; i < assignments.length; ++i)
              for (int k : assignments[i].assignments()) {
                  // Check that the item was place in a cluster
                  if (k >= 0)
                      clusters.get(k).add(i);
              }
          return clusters;
      }
docs: Returns the data point indices assigned to each cluster.  Note that if
  the underlying clustering algorithm does not put some items in a cluster
  (i.e., their cluster assignment is negative) then these items will not be
  returned as a part of any cluster.