code: public static double calculate(IBitFingerprint fingerprint1, IBitFingerprint fingerprint2) {
          if (fingerprint1.size() != fingerprint2.size()) {
              throw new IllegalArgumentException("Fingerprints must have the same size");
          }
          int cardinality1 = fingerprint1.cardinality();
          int cardinality2 = fingerprint2.cardinality();
          // If the fingerprint is an IntArrayFingeprint that could mean a big
          // fingerprint so let's take the safe way out and create a
          // new IntArrayfingerprint
          IBitFingerprint one_and_two = fingerprint1 instanceof IntArrayFingerprint ? new IntArrayFingerprint(
                  fingerprint1) : new BitSetFingerprint(fingerprint1);
          one_and_two.and(fingerprint2);
          double cardinalityCommon = one_and_two.cardinality();
          return cardinalityCommon / (cardinality1 + cardinality2 - cardinalityCommon);
      }
docs: Evaluates Tanimoto coefficient for two <code>IBitFingerprint</code>.
  <p>
  @param fingerprint1 fingerprint for the first molecule
  @param fingerprint2 fingerprint for the second molecule
  @return The Tanimoto coefficient
  @throws IllegalArgumentException if bitsets are not of the same length