/**
   * Generates a shortest path based BitSet fingerprint for the given AtomContainer.
   *
   * @param ac The AtomContainer for which a fingerprint is generated
   * @exception CDKException if there error in aromaticity perception or other CDK functions
   * @return A {@link BitSet} representing the fingerprint
   */
  @Override
  public IBitFingerprint getBitFingerprint(IAtomContainer ac) throws CDKException {

    IAtomContainer atomContainer = null;
    try {
      atomContainer = (IAtomContainer) ac.clone();
    } catch (CloneNotSupportedException ex) {
      logger.error("Failed to clone the molecule:", ex);
    }
    Aromaticity.cdkLegacy().apply(atomContainer);
    BitSet bitSet = new BitSet(fingerprintLength);
    if (!ConnectivityChecker.isConnected(atomContainer)) {
      IAtomContainerSet partitionedMolecules =
          ConnectivityChecker.partitionIntoMolecules(atomContainer);
      for (IAtomContainer container : partitionedMolecules.atomContainers()) {
        addUniquePath(container, bitSet);
      }
    } else {
      addUniquePath(atomContainer, bitSet);
    }
    return new BitSetFingerprint(bitSet);
  }