class CombinedAtomicMassNumberRule implements ISequenceSubRule<ILigand> {

    @Override
    public int compare(ILigand ligand1, ILigand ligand2) {
        int atomicNumberComp = atomicNumberRule.compare(ligand1, ligand2);
        if (atomicNumberComp != 0) return atomicNumberComp;

        int massNumberComp = massNumberRule.compare(ligand1, ligand2);
        if (massNumberComp != 0) return massNumberComp;

        if ("H".equals(ligand1.getLigandAtom().getSymbol())) {
            // both atoms are hydrogens
            return 0;
        }

        return massNumberComp;
    }

}