### Question:
CompositeMetric implements ClusterMetric { @Override public double mean() { return clusterMetrics.stream().map(metric -> metric.mean() * metric.count()) .reduce(Double::sum) .orElse((double) 0) / count(); } CompositeMetric(ClusterMetric ... clusterMetric);  CompositeMetric(ClusterMetric clusterMetric, Iterable<ClusterMetric> clusterMetrics);  CompositeMetric(Iterable<ClusterMetric> clusterMetrics); @Override double value(); @Override long count(); @Override double min(); @Override double max(); @Override double mean(); @Override String toString();  }### Answer:
@Test public void mean() { assertEquals(5, compositeMetric.mean(), 0); }