Implemented unit tests for reusing threads.