updated code in TreeSetDemo.java