I think below implementation of a comprator is wrong. It will got give me a sorted order of Strings. But when i use this implementation to sort a List it does not throw the below exception : "java.lang.IllegalArgumentException: Comparison method violates its general contract!"
Question : Why above Exception is not thrown by Collections.sort(list, new WrongComparator()) method call ?
public class WrongComparator implements Comparator<String> {
public int compare(String o1, String o2){
return 1;
}
}