XWIKI-10289: "java.lang.IllegalArgumentException: Comparison method violates its general contract!" on Java 7

(cherry picked from commit f2a5df54247287ca1b70000c3adaf1da5ff48741)