class LonePairDiff {

    public static IDifference difference(IChemObject first, IChemObject second) {
        if (!(first instanceof ILonePair && second instanceof ILonePair)) {
            return null;
        }
        ILonePair firstB = (ILonePair) first;
        ILonePair secondB = (ILonePair) second;
        IDifferenceList totalDiff = new ChemObjectDifference("LonePairDiff");
        totalDiff.addChild(AtomDiff.difference(firstB.getAtom(), secondB.getAtom()));
        totalDiff.addChild(ElectronContainerDiff.difference(first, second));
        if (totalDiff.childCount() > 0) {
            return totalDiff;
        } else {
            return null;
        }
    }

    private  LonePairDiff();

}