class PreProcessorPrecedenceComparator implements Comparator<IPreProcessor> {


        PreProcessorPrecedenceComparator() {
            super();
        }


        public int compare(final IPreProcessor o1, final IPreProcessor o2) {<FILL_FUNCTION_BODY>}


        /*
         * Processors are wrapped and therefore we can apply dialect precedence
         */
        private int compareWrapped(final ProcessorConfigurationUtils.PreProcessorWrapper o1w, final ProcessorConfigurationUtils.PreProcessorWrapper o2w) {

            final int dialectPrecedenceComp = compareInts(o1w.getDialect().getDialectProcessorPrecedence(), o2w.getDialect().getDialectProcessorPrecedence());
            if (dialectPrecedenceComp != 0) {
                return dialectPrecedenceComp;
            }

            final IPreProcessor o1 = o1w.unwrap();
            final IPreProcessor o2 = o2w.unwrap();

            final int processorPrecedenceComp = compareInts(o1.getPrecedence(), o2.getPrecedence());
            if (processorPrecedenceComp != 0) {
                return processorPrecedenceComp;
            }
            final int classNameComp = o1.getClass().getName().compareTo(o2.getClass().getName());
            if (classNameComp != 0) {
                return classNameComp;
            }
            return compareInts(System.identityHashCode(o1), System.identityHashCode(o2)); // Cannot be 0

        }


        private static int compareInts(int x, int y) {
            return (x < y) ? -1 : ((x == y) ? 0 : 1);
        }

    }

            if (o1 == o2) {
                // This is the only case in which the comparison of two processors will return 0
                return 0;
            }
            if (o1 instanceof ProcessorConfigurationUtils.PreProcessorWrapper && o2 instanceof ProcessorConfigurationUtils.PreProcessorWrapper) {
                return compareWrapped((ProcessorConfigurationUtils.PreProcessorWrapper)o1, (ProcessorConfigurationUtils.PreProcessorWrapper)o2);
            }
            final int preProcessorPrecedenceComp = compareInts(o1.getPrecedence(), o2.getPrecedence());
            if (preProcessorPrecedenceComp != 0) {
                return preProcessorPrecedenceComp;
            }
            final int classNameComp = o1.getClass().getName().compareTo(o2.getClass().getName());
            if (classNameComp != 0) {
                return classNameComp;
            }
            return compareInts(System.identityHashCode(o1), System.identityHashCode(o2)); // Cannot be 0
        
<no_super_class>