Collections.sort() Comparison method violates its general contract in Java [duplicate]
问题 This question already has answers here : “Comparison method violates its general contract!” (11 answers) Closed 2 years ago . I know that this kind of question has been asked millions of times if not billions, however I couldn't find my answer yet :) This compare() method doesn't have Long , Double , Float , ..., it only has Date , boolean , and Null checker, however it shows me that contract violation error , can any one help plz? Collections.sort(users, new Comparator<MiniUser>() {