private void sortInvokersByPattern(List<StepInvoker> stepInvokers) {
        Collections.sort(stepInvokers, new Comparator<StepInvoker>() {
            public int compare(StepInvoker o1, StepInvoker o2) {
                return o1.getStepPattern().toString().compareTo(o2.getStepPattern().toString());
            }
        });
    }
private void sortInvokersByPattern ( List < StepInvoker > stepInvokers ) { Collections . sort ( stepInvokers , new Comparator < StepInvoker > ( ) { public int compare ( StepInvoker o1 , StepInvoker o2 ) { return o1 . getStepPattern ( ) . toString ( ) . compareTo ( o2 . getStepPattern ( ) . toString ( ) ) ; } } ) ; }
prefer fully determinate behaviour. The only sensible solution is to sort by pattern