I guess you want '||' in your equals method instead of '&&'.
You get the NullPointerException on the line System.out.println("Set contains --" + t.count); You get null from the Set, so t == null, so t.count gives you the exception. So you don't get the exception in the setting, but in the getting
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com