change the thread pool Executors.newCachedThreadPool() to Executors.newFixedThreadPool()