docs: protected List<double[]> means(List<? extends ModifiableDBIDs> clusters, List<double[]> means, Relation<DiscreteUncertainObject> database) {
      List<double[]> newMeans = new ArrayList<>(k);
      for(int i = 0; i < k; i++) {
        ModifiableDBIDs list = clusters.get(i);
        double[] mean = null;
        if(list.size() > 0) {
          DBIDIter iter = list.iter();
          // Initialize with first.
          mean = ArrayLikeUtil.toPrimitiveDoubleArray(database.get(iter).getCenterOfMass());
          iter.advance();
          // Update with remaining instances
          for(; iter.valid(); iter.advance()) {
            NumberVector vec = database.get(iter).getCenterOfMass();
            for(int j = 0; j < mean.length; j++) {
              mean[j] += vec.doubleValue(j);
            }
          }
          timesEquals(mean, 1.0 / list.size());
        }
        else {
          // Keep degenerated means as-is for now.
          mean = means.get(i);
        }
        newMeans.add(mean);
      }
      return newMeans;
    }