how to check if a thread is dead or asleep in java code example Example: java check if thread is running Thread.isAlive()