@Test
public void testPlaceHydrogens2D() throws Exception {

    HydrogenPlacer hydrogenPlacer = new HydrogenPlacer();
    IAtomContainer dichloromethane = new AtomContainer();
    Atom carbon = new Atom("C");
    Point2d carbonPos = new Point2d(0.0, 0.0);
    carbon.setPoint2d(carbonPos);
    Atom h1 = new Atom("H");
    Atom h2 = new Atom("H");
    Atom cl1 = new Atom("Cl");
    Point2d cl1Pos = new Point2d(0.0, -1.0);
    cl1.setPoint2d(cl1Pos);
    Atom cl2 = new Atom("Cl");
    Point2d cl2Pos = new Point2d(-1.0, 0.0);
    cl2.setPoint2d(cl2Pos);
    dichloromethane.addAtom(carbon);
    dichloromethane.addAtom(h1);
    dichloromethane.addAtom(h2);
    dichloromethane.addAtom(cl1);
    dichloromethane.addAtom(cl2);
    dichloromethane.addBond(new Bond(carbon, h1));
    dichloromethane.addBond(new Bond(carbon, h2));
    dichloromethane.addBond(new Bond(carbon, cl1));
    dichloromethane.addBond(new Bond(carbon, cl2));
    Assert.assertNull(h1.getPoint2d());
    Assert.assertNull(h2.getPoint2d());
    // generate new coords
    hydrogenPlacer.placeHydrogens2D(dichloromethane, carbon);
    // check that previously set coordinates are kept
    assertEquals(carbonPos, carbon.getPoint2d(), 0.01);
    assertEquals(cl1Pos, cl1.getPoint2d(), 0.01);
    assertEquals(cl2Pos, cl2.getPoint2d(), 0.01);
    Assert.assertNotNull(h1.getPoint2d());
    Assert.assertNotNull(h2.getPoint2d());
}