CIPTool { public static ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom, int ligandAtom) { if (ligandAtom == HYDROGEN) { return new ImplicitHydrogenLigand(container, visitedAtoms, container.getAtom(chiralAtom)); } else { return new Ligand(container, visitedAtoms, container.getAtom(chiralAtom), container.getAtom(ligandAtom)); } }  static CIP_CHIRALITY getCIPChirality(LigancyFourChirality stereoCenter); static void label(IAtomContainer container); static CIP_CHIRALITY getCIPChirality(IAtomContainer container, ITetrahedralChirality stereoCenter); static CIP_CHIRALITY getCIPChirality(IAtomContainer container, IDoubleBondStereochemistry stereoCenter); static boolean checkIfAllLigandsAreDifferent(ILigand[] ligands); static ILigand[] order(ILigand[] ligands); static LigancyFourChirality defineLigancyFourChirality(IAtomContainer container, int chiralAtom,
            int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo); static ILigand defineLigand(IAtomContainer container, VisitedAtoms visitedAtoms, int chiralAtom,
            int ligandAtom); static ILigand[] getLigandLigands(ILigand ligand); static final int HYDROGEN; }
@Test public void testDefineLigand() { ILigand ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 1, 2); Assert.assertEquals(molecule, ligand.getAtomContainer()); Assert.assertEquals(molecule.getAtom(1), ligand.getCentralAtom()); Assert.assertEquals(molecule.getAtom(2), ligand.getLigandAtom()); }
@Test public void testDefineLigand_ImplicitHydrogen() throws Exception { IAtomContainer molecule = smiles.parseSmiles("CC(C)C(C#N)(C(=C)C)"); ILigand ligand = CIPTool.defineLigand(molecule, new VisitedAtoms(), 3, CIPTool.HYDROGEN); Assert.assertTrue(ligand instanceof ImplicitHydrogenLigand); }