code: public static void shutdown(@Nonnull final ExecutorService executorService, @Nonnegative final long duration,
  			@Nonnull final TimeUnit unit) {
  		Check.notNull(executorService, "executorService");
  		Check.notNull(duration, "duration");
  		Check.notNull(unit, "unit");
  
  		executorService.shutdown();
  		try {
  			if (!executorService.awaitTermination(duration, unit)) {
  				LOG.info(String.format("Executor did not terminate in %s %s.", duration, unit.name().toLowerCase()));
  				final List<Runnable> droppedTasks = executorService.shutdownNow();
  				LOG.info("Executor was abruptly shut down. " + droppedTasks.size() + " tasks will not be executed.");
  			}
  			unregisterIfPossible(executorService);
  		} catch (final InterruptedException e) {
  			LOG.warn("Executor termination failed: " + e.getLocalizedMessage(), e);
  		}
  	}
docs: Shutdowns the given {@code ExecutorService} as soon as possible, but not later than the specified time.
  
  @param executorService
  executor to stop
  @param duration
  duration as a numerical value
  @param unit
  duration unit