Source code:
@Grab(group='org.openscience.cdk', module='cdk-bundle', version='2.9')
import org.openscience.cdk.interfaces.*;
import org.openscience.cdk.io.*;
import org.openscience.cdk.ringsearch.*;
import org.openscience.cdk.io.IChemObjectReader.Mode;
import org.openscience.cdk.*;
import java.io.File;
reader = new MDLV2000Reader(
new File("data/azulene.mol").newReader(),
Mode.STRICT
);
azulene = reader.read(new AtomContainer());
ringFinder = new AllRingsFinder(AllRingsFinder.Threshold.PubChem_99)
ringset = ringFinder.findAllRings(azulene)
Output: