VecmathUtil { static Vector2d newPerpendicularVector(final Vector2d vector) { return new Vector2d(-vector.y, vector.x); } private  VecmathUtil();   }
@Test public void testNewPerpendicularVector() throws Exception { Vector2d perpendicular = VecmathUtil.newPerpendicularVector(new Vector2d(5, 2)); assertThat(perpendicular.x, closeTo(-2d, 0.01)); assertThat(perpendicular.y, closeTo(5d, 0.01)); }