@Test
public void testNewUnitVectorFromBond() throws Exception {

    IAtom a1 = mock(IAtom.class);
    IAtom a2 = mock(IAtom.class);
    when(a1.getPoint2d()).thenReturn(new Point2d(0, 1));
    when(a2.getPoint2d()).thenReturn(new Point2d(1, 0));
    IBond bond = mock(IBond.class);
    when(bond.getOther(a1)).thenReturn(a2);
    when(bond.getOther(a2)).thenReturn(a1);
    Vector2d unit = VecmathUtil.newUnitVector(a1, bond);
    assertThat(unit.x, closeTo(0.707d, 0.01));
    assertThat(unit.y, closeTo(-0.707d, 0.01));
    assertThat(unit.length(), closeTo(1d, 0.01));
}