CIPTool { public static void label(IAtomContainer container) { for (IStereoElement stereoElement : container.stereoElements()) { if (stereoElement instanceof ITetrahedralChirality) { ITetrahedralChirality tc = (ITetrahedralChirality) stereoElement; tc.getChiralAtom().setProperty(CDKConstants.CIP_DESCRIPTOR, getCIPChirality(container, tc).toString()); } else if (stereoElement instanceof IDoubleBondStereochemistry) { IDoubleBondStereochemistry dbs = (IDoubleBondStereochemistry) stereoElement; dbs.getStereoBond() .setProperty(CDKConstants.CIP_DESCRIPTOR, getCIPChirality(container, dbs).toString()); } } }  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 label() throws Exception { IAtomContainer container = new SmilesParser(SilentChemObjectBuilder.getInstance()) .parseSmiles("C/C=C/[C@@H](C)C(/C)=C(/C)C[C@H](C)O"); CIPTool.label(container); assertThat(container.getAtom(3).getProperty(CDKConstants.CIP_DESCRIPTOR, String.class), CoreMatchers.is("R")); assertThat(container.getAtom(10).getProperty(CDKConstants.CIP_DESCRIPTOR, String.class), CoreMatchers.is("S")); assertThat( container.getBond(container.getAtom(1), container.getAtom(2)).getProperty(CDKConstants.CIP_DESCRIPTOR, String.class), CoreMatchers.is("E")); assertThat( container.getBond(container.getAtom(5), container.getAtom(7)).getProperty(CDKConstants.CIP_DESCRIPTOR, String.class), CoreMatchers.is("Z")); }