Avoid ever having a null collection. It's much better to assume you have a valid collection and check the size for something greater than zero. Also, unless you have an old version of Java you should specifiy what is in your collection. Never use Hashtable: use HashMap. You can synchronize access to your HashMap, if needed, and use it consitently everywhere. Finally, always declare the collection interface not the concrete type.
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