@Test
public void testCalculateWeightedAverage() {

    Map<Long, Double> keyMetrics = new HashMap<>();
    keyMetrics.put(1L, 10.0);
    keyMetrics.put(2L, 20.0);
    Map<Long, Double> weightMetrics = new HashMap<>();
    weightMetrics.put(1L, 10.0);
    weightMetrics.put(2L, 5.0);
    double actual = ComponentMetricSummary.calculateWeightedAverage(keyMetrics, weightMetrics);
    // 10.0 * 10.0 / (10.0 + 5.0) + 20.0 * 5.0 / (10.0 + 5.0)
    double expected = 13.333333333d;
    Assert.assertEquals(expected, actual, DoubleUtils.EPSILON);
}