demo code of http://www.ibm.com/developerworks/java/library/j-jcomp/index.html