class SimpleAtomComparator implements Comparator<IAtom>, Serializable {

    @Override
    public int compare(IAtom o1, IAtom o2) {
        if (o1.getSymbol().equalsIgnoreCase(o2.getSymbol())) {
            if (o1.getHybridization() != null && o2.getHybridization() != null) {
                return o1.getHybridization().compareTo(o2.getHybridization());
            }
            return 0;
        }
        return 10 * o1.getSymbol().compareToIgnoreCase(o2.getSymbol());
    }

}