added an test/example of using Runtime.addShutdownHook()