@Test
public void testOrder() throws Exception {

    IAtomContainer molecule = smiles.parseSmiles("CC(Br)([13C])[H]");
    List<ILigand> ligands = new ArrayList<ILigand>();
    VisitedAtoms visitedAtoms = new VisitedAtoms();
    ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 4));
    ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 3));
    ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 2));
    ligands.add(CIPTool.defineLigand(molecule, visitedAtoms, 1, 0));
    Collections.sort(ligands, new CIPLigandRule());
    Assert.assertEquals("H", ligands.get(0).getLigandAtom().getSymbol());
    Assert.assertEquals("C", ligands.get(1).getLigandAtom().getSymbol());
    Assert.assertEquals("C", ligands.get(2).getLigandAtom().getSymbol());
    Assert.assertEquals(13, ligands.get(2).getLigandAtom().getMassNumber().intValue());
    Assert.assertEquals("Br", ligands.get(3).getLigandAtom().getSymbol());
}