class ElementDiff {

    public static IDifference difference(IChemObject first, IChemObject second) {
        if (!(first instanceof IElement && second instanceof IElement)) {
            return null;
        }
        IElement firstElem = (IElement) first;
        IElement secondElem = (IElement) second;
        ChemObjectDifference coDiff = new ChemObjectDifference("ElementDiff");
        coDiff.addChild(StringDifference.construct("S", firstElem.getSymbol(), secondElem.getSymbol()));
        coDiff.addChild(StringDifference.construct("ID", firstElem.getID(), secondElem.getID()));
        coDiff.addChild(IntegerDifference.construct("AN", firstElem.getAtomicNumber(), secondElem.getAtomicNumber()));
        coDiff.addChild(ChemObjectDiff.difference(first, second));
        if (coDiff.childCount() > 0) {
            return coDiff;
        } else {
            return null;
        }
    }

    private  ElementDiff();

}