implement and test shutdown() and isShutdown()