This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Above code throws ClassCastException at line 6. i know that for TreeSet its elements should be mutally comparable. if i replaces Comparator with Comparable then class compiles and runs fine but elements doesnot sorting.