The compareTo function in the dom4j Rules class is broken in that its not symmetric.
This breaks the RuleTest greaterThan test when executing with openjdk-7 (I suspect the sort algorithm has probably changed).
r1 > r2 = 1
r2 < r1 = 0 (should be -1)
Attached patch fixes this issue and adds some extra tests to cover all > < and ==