static Speed mean(Speed... speeds) {
        double n = speeds.length;

        Speed spd = Speed.ZERO;
        for (Speed speed : speeds) {
            spd = spd.plus(speed);
        }
        return spd.times(1.0 / n);
    }
@Test
    public void meanSpeedIsComputedCorrectly() {
        Speed negativeTenKnots = Speed.of(-10, KNOTS);
        Speed oneKnot = Speed.of(1, KNOTS);
        Speed fiveKnots = Speed.of(5, KNOTS);
        Speed nineKnots = Speed.of(9, KNOTS);

        assertThat(
            mean(oneKnot, nineKnots, fiveKnots).toString(5), //avg of 1, 5, 9
            is(Speed.of(5.0, KNOTS).toString(5))
        );

        assertThat(
            mean(oneKnot, nineKnots, negativeTenKnots).toString(5), //avg of 1, 9, -10
            is(Speed.of(0.0, KNOTS).toString(5))
        );
    }