Why does my TreeSet not add anything beyond the first element?
If you put your objects in a TreeSet, you need to either provide an implementation of the Comparator interface in the constructor, or you need your objects to be of a class that implements Comparable. You said you implement compareTo from the Comparable interface, but in your comment you say that you didn’t, so am … Read more