class ChemObjectDiff {

    public static IDifference difference(IChemObject first, IChemObject second) {
        if (!(first instanceof IChemObject && second instanceof IChemObject)) {
            return null;
        }
        IChemObject firstElem = (IChemObject) first;
        IChemObject secondElem = (IChemObject) second;
        ChemObjectDifference coDiff = new ChemObjectDifference("ChemObjectDiff");
        // Compare flags
        boolean[] firstFlags = firstElem.getFlags();
        boolean[] secondFlags = secondElem.getFlags();
        coDiff.addChild(BooleanArrayDifference.construct("flag", firstFlags, secondFlags));
        if (coDiff.childCount() > 0) {
            return coDiff;
        } else {
            return null;
        }
    }

    private  ChemObjectDiff();

}