Recently I updated our application jdk from Java 6 to Java 8 but kept source language level still as Java 6. After change one of our unit tests was failing. I noticed that Collections.sort for LinkedList is working different in Java 8 and Java 6. Even when I am Source Level java 8 with JDk 1.8 I am getting same different behavior. To recreate problem: Defining the enum below: Recently I updated our application jdk from Jav