@Test
public void testAverage() throws Exception {

    Vector2d mean = VecmathUtil.average(Arrays.asList(new Vector2d(0.5, 0.5), new Vector2d(0.5, -0.5)));
    assertThat(mean.x, closeTo(0.5d, 0.01));
    assertThat(mean.y, closeTo(0d, 0.01));
}