List<String> list = Arrays.asList("Snehal", "Masne", "Anything", "Else");
HashSet<String> hashSet = new HashSet<String>(list);
TreeSet<String> treeSet = new TreeSet<String>(list);
System.out.println("Equality = " + hashSet.equals(treeSet)); // returns True
How the equals() is evaluating the result by comparing diff structures? How come its true? Is just Hashcode being compared? If so, how come its same?