code: public static IDifference difference(IChemObject first, IChemObject second) {
          if (!(first instanceof IAtom && second instanceof IAtom)) {
              return null;
          }
          IAtom firstElem = (IAtom) first;
          IAtom secondElem = (IAtom) second;
          ChemObjectDifference totalDiff = new ChemObjectDifference("AtomDiff");
          totalDiff.addChild(IntegerDifference.construct("H", firstElem.getImplicitHydrogenCount(),
                  secondElem.getImplicitHydrogenCount()));
          totalDiff
                  .addChild(IntegerDifference.construct("SP", firstElem.getStereoParity(), secondElem.getStereoParity()));
          totalDiff.addChild(Point2dDifference.construct("2D", firstElem.getPoint2d(), secondElem.getPoint2d()));
          totalDiff.addChild(Point3dDifference.construct("3D", firstElem.getPoint3d(), secondElem.getPoint3d()));
          totalDiff.addChild(Point3dDifference.construct("F3D", firstElem.getFractionalPoint3d(),
                  secondElem.getFractionalPoint3d()));
          totalDiff.addChild(DoubleDifference.construct("C", firstElem.getCharge(), secondElem.getCharge()));
          totalDiff.addChild(AtomTypeDiff.difference(first, second));
          if (totalDiff.childCount() > 0) {
              return totalDiff;
          } else {
              return null;
          }
      }
docs: Compare two {@link IChemObject} classes and return the difference as an {@link IDifference}.
  
  @param first  the first of the two classes to compare
  @param second the second of the two classes to compare
  @return an {@link IDifference} representation of the difference between the first and second {@link IChemObject}.