@Test
public void testSplit() throws CDKException {

    IAtomContainer mol = smilesParser.parseSmiles("C1CC1C2CCC2");
    SpanningTree st = new SpanningTree(mol);
    IRingSet rings = st.getAllRings();
    IBond splitBond = null;
    for (int i = 0; i < mol.getBondCount(); i++) {
        if (rings.getRings(mol.getBond(i)).getAtomContainerCount() == 0) {
            splitBond = mol.getBond(i);
            break;
        }
    }
    List<IAtomContainer> frags = FragmentUtils.splitMolecule(mol, splitBond);
    SmilesGenerator sg = new SmilesGenerator();
    Set<String> uniqueFrags = new HashSet<String>();
    for (IAtomContainer frag : frags) {
        uniqueFrags.add(sg.create(frag));
    }
    Assert.assertEquals(2, uniqueFrags.size());
    // You can put the fragments back together with a ring closure and dot
    // [CH]12CC1.[CH]12CCC1
    org.hamcrest.MatcherAssert.assertThat(uniqueFrags, hasItems("[CH]1CC1", "[CH]1CCC1"));
}