Exception in thread "main" java.lang.ClassCastException: Dog cannot be cast to java.lang.Comparable at java.util.TreeMap.put(TreeMap.java:542) at java.util.TreeSet.add(TreeSet.java:238) at MainClass.main(MainClass.java:17)