how to check if thread is finished in java code example Example: java check if thread is running Thread.isAlive()