I am checking how TreeSet checks for duplicate elements and have the following code
import java.util.*; public class TreeDemo{ public static void main(
TreeSet implements a balanced binary search tree based upon ordering of its members (via the Comparable or Comparator interfaces), not on hashing.
http://en.wikipedia.org/wiki/Self-balancing_binary_search_tree