code: public static boolean isIsomorph(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds)
              throws CDKException {
          if (sourceGraph instanceof IQueryAtomContainer) {
              throw new CDKException("The first IAtomContainer must not be an IQueryAtomContainer");
          }
  
          if (targetGraph.getAtomCount() != sourceGraph.getAtomCount()) {
              return false;
          }
          // check single atom case
          if (targetGraph.getAtomCount() == 1) {
              IAtom atom = sourceGraph.getAtom(0);
              IAtom atom2 = targetGraph.getAtom(0);
              if (atom instanceof IQueryAtom) {
                  IQueryAtom qAtom = (IQueryAtom) atom;
                  return qAtom.matches(targetGraph.getAtom(0));
              } else if (atom2 instanceof IQueryAtom) {
                  IQueryAtom qAtom = (IQueryAtom) atom2;
                  return qAtom.matches(sourceGraph.getAtom(0));
              } else {
                  String atomSymbol = atom2.getSymbol();
                  return sourceGraph.getAtom(0).getSymbol().equals(atomSymbol);
              }
          }
          return (getIsomorphMap(sourceGraph, targetGraph, shouldMatchBonds) != null);
      }
docs: Tests if sourceGraph and targetGraph are isomorph.
  
  @param  sourceGraph  first molecule. Must not be an IQueryAtomContainer.
  @param  targetGraph  second molecule. May be an IQueryAtomContainer.
  @param shouldMatchBonds
  @return     true if the 2 molecule are isomorph
  @throws org.openscience.cdk.exception.CDKException if the first molecule is an instance
  of IQueryAtomContainer