How does `TreeSet` handle duplicate elements in Java?
If a duplicate element is added, `TreeSet` replaces the old element with the new one.
Youâ€™re partially correct, but `TreeSet` does not replace duplicate elements. It just ignores them.
What is the best way to add elements to a `TreeSet` without worrying about duplicates?