CIPTool { public static LigancyFourChirality defineLigancyFourChirality(IAtomContainer container, int chiralAtom, int ligand1, int ligand2, int ligand3, int ligand4, Stereo stereo) { int[] atomIndices = {ligand1, ligand2, ligand3, ligand4}; VisitedAtoms visitedAtoms = new VisitedAtoms(); ILigand[] ligands = new ILigand[4]; for (int i = 0; i < 4; i++) { ligands[i] = defineLigand(container, visitedAtoms, chiralAtom, atomIndices[i]); } return new LigancyFourChirality(container.getAtom(chiralAtom), ligands, stereo); }  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 testDefineLigancyFourChirality() { LigancyFourChirality chirality = CIPTool.defineLigancyFourChirality(molecule, 1, 0, 2, 3, 4, Stereo.ANTI_CLOCKWISE); Assert.assertEquals(molecule.getAtom(1), chirality.getChiralAtom()); Assert.assertEquals(Stereo.ANTI_CLOCKWISE, chirality.getStereo()); ILigand[] ligands = chirality.getLigands(); Assert.assertEquals(molecule, ligands[0].getAtomContainer()); Assert.assertEquals(molecule.getAtom(0), ligands[0].getLigandAtom()); Assert.assertEquals(molecule.getAtom(1), ligands[0].getCentralAtom()); Assert.assertEquals(molecule, ligands[1].getAtomContainer()); Assert.assertEquals(molecule.getAtom(2), ligands[1].getLigandAtom()); Assert.assertEquals(molecule.getAtom(1), ligands[1].getCentralAtom()); Assert.assertEquals(molecule, ligands[2].getAtomContainer()); Assert.assertEquals(molecule.getAtom(3), ligands[2].getLigandAtom()); Assert.assertEquals(molecule.getAtom(1), ligands[2].getCentralAtom()); Assert.assertEquals(molecule, ligands[3].getAtomContainer()); Assert.assertEquals(molecule.getAtom(4), ligands[3].getLigandAtom()); Assert.assertEquals(molecule.getAtom(1), ligands[3].getCentralAtom()); }