code: private IRingSet getRingSetCore(IRingSet rs) {
  
          Multimap<IBond, IRing> ringlookup = HashMultimap.create();
          Set<IRing> ringsystem = new LinkedHashSet<>();
  
          for (IAtomContainer ring : rs.atomContainers()) {
              ringsystem.add((IRing) ring);
              for (IBond bond : ring.bonds())
                  ringlookup.put(bond, (IRing) ring);
          }
  
          // iteratively reduce ring system by removing ring that only share one bond
          Set<IRing> toremove = new HashSet<>();
          do {
              toremove.clear();
              for (IRing ring : ringsystem) {
                  int numAttach = 0;
                  for (IBond bond : ring.bonds()) {
                      for (IRing attached : ringlookup.get(bond)) {
                          if (attached != ring && ringsystem.contains(attached)) {
                              numAttach++;
                              break;
                          }
                      }
                  }
                  if (numAttach <= 1)
                      toremove.add(ring);
              }
              ringsystem.removeAll(toremove);
          } while (!toremove.isEmpty());
  
          final IRingSet core = rs.getBuilder().newInstance(IRingSet.class);
          for (IRing ring : ringsystem)
              core.addAtomContainer(ring);
  
          return core;
      }
docs: Peel back terminal rings to the complex 'core': {@cdk.cite Helson99}, {@cdk.cite Clark06}.
  
  @param rs ring set
  @return the ring set core