@Test
public void testGetNearestVector2() throws Exception {

    // not unit vectors, but okay for test
    Vector2d nearest = VecmathUtil.getNearestVector(new Vector2d(0, -1),
            Arrays.asList(new Vector2d(0.5, 0.5), new Vector2d(0.5, -0.5)));
    assertThat(nearest.x, closeTo(0.5d, 0.01));
    assertThat(nearest.y, closeTo(-0.5d, 0.01));
}