code: public int apply(final IAtomContainer mol) {
          List<Sgroup> newSgroups = generate(mol);
          List<Sgroup> sgroups = mol.getProperty(CDKConstants.CTAB_SGROUPS);
  
          if (sgroups == null)
              sgroups = new ArrayList<>();
          else
              sgroups = new ArrayList<>(sgroups);
  
          int prev = sgroups.size();
          for (Sgroup sgroup : newSgroups) {
              double coverage = sgroup.getAtoms().size() / (double) mol.getAtomCount();
              // update javadoc if changed!
              if (sgroup.getBonds().isEmpty() || coverage < 0.4d)
                  sgroups.add(sgroup);
          }
          mol.setProperty(CDKConstants.CTAB_SGROUPS, Collections.unmodifiableList(sgroups));
          return sgroups.size() - prev;
      }
docs: Generates and assigns abbreviations to a molecule. Abbrevations are first
  generated with {@link #generate} and the filtered based on
  the coverage. Currently only abbreviations that cover 100%, or &lt; 40% of the
  atoms are assigned.
  
  @param mol molecule
  @return number of new abbreviations
  @see #generate(IAtomContainer)