class PriorityServiceComparator implements Comparator<Object>, Serializable {

    @Override
    public int compare(Object o1, Object o2) {
        int prio = getPriority(o1) - getPriority(o2);
        if (prio < 0) {
            return 1;
        } else if (prio > 0) {
            return -1;
        } else {
            return o1.getClass().getSimpleName().compareTo(o2.getClass().getSimpleName());
        }
    }

    private  PriorityServiceComparator();

}