As a rule, you should not distribute Thread directly, as this simply leads to confusion, as here.
Your TestThread never starts, so you cannot join it. All he does is act like Runnable (which is exactly what you should use).
If you want to wait for the task to complete.
Future future = executorService.submit(new TestRunnable());
BTW: after Java 5.0 appeared in Java 1.4.2, followed by Java 6 and Java 7.
source share