The list of methods to do Thread Executor are organized into topic(s).
Map
getConstantLookup()
get Constant Lookup
Map<String, String> toRet = new HashMap<>();
toRet.put("java.util.concurrent.BlockingDeque", "BLOCKING_DEQUE");
toRet.put("java.util.concurrent.BlockingQueue", "BLOCKING_QUEUE");
toRet.put("java.util.concurrent.Callable", "CALLABLE");
toRet.put("java.util.concurrent.CompletionService", "COMPLETION_SERVICE");
toRet.put("java.util.concurrent.ConcurrentMap", "CONCURRENT_MAP");
toRet.put("java.util.concurrent.ConcurrentNavigableMap", "CONCURRENT_NAVIGABLE_MAP");
toRet.put("java.util.concurrent.Delayed", "DELAYED");
...
boolean
isCorrectCollectionSizeTimeOut(Collection> collection, int size, long timeout, TimeUnit unit) Check size of a collection populated in another thread.
Runnable task = () -> {
try {
while (collection.size() != size) {
TimeUnit.MILLISECONDS.sleep(10);
} catch (InterruptedException e) {
throw new IllegalStateException("task interrupted", e);
};
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.submit(task);
executor.shutdown();
return executor.awaitTermination(timeout, unit);
boolean
isRegularlyDone(Future> future) Checks if the specified Future terminated regularly, e.g.
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
return false;
return true;
boolean
isShutdown(Executor executor) is Shutdown
if (executor instanceof ExecutorService) {
if (((ExecutorService) executor).isShutdown()) {
return true;
return false;