code: public static List<List<DataPoint>> createClusterListFromAssignmentArray(int[] assignments, DataSet dataSet)
      {
          List<List<DataPoint>> clusterings = new ArrayList<>();
          
          for(int i = 0; i < dataSet.size(); i++)
          {
              while(clusterings.size() <= assignments[i])
                  clusterings.add(new ArrayList<>());
              if(assignments[i] >= 0)
                  clusterings.get(assignments[i]).add(dataSet.getDataPoint(i));
          }
          
          return clusterings;
      }
docs: Convenient helper method. A list of lists to represent a cluster may be desirable. In
  such a case, this method will take in an array of cluster assignments, and return a
  list of lists.
  
  @param assignments the array containing cluster assignments
  @param dataSet the original data set, with data in the same order as was used to create the assignments array
  @return a List of lists where each list contains the data points for one cluster, and the lists are in order by cluster id.