code: public static <T> Future<T> take(CompletionService<T> cs, String callerClass, String callerMethod, Object... args)
  	throws InterruptedException {
  		final String sourceMethod = "take"; //$NON-NLS-1$
  		final boolean isTraceLogging = log.isLoggable(Level.FINER);
  		if (isTraceLogging) {
  			log.entering(sourceClass, sourceMethod, new Object[]{Thread.currentThread(), cs, callerClass, callerMethod, args});
  		}
  		long start = System.currentTimeMillis();
  		boolean quiesced = false, logged = false;
  		Future<T> future = null;
  		while ((future = cs.poll(SIGNAL_LOG_INTERVAL_SECONDS, TimeUnit.SECONDS)) == null) {
  			if (!quiesced) {
  				quiesced = logWaiting(callerClass, callerMethod, cs, start, args);
  				logged = true;
  			}
  		}
  		if (logged) {
  			logResuming(callerClass, callerMethod, cs, start);
  		}
  		if (isTraceLogging) {
  			log.exiting(sourceClass, sourceMethod, Arrays.asList(Thread.currentThread(), cs, callerClass, callerMethod, future));
  		}
  		return future;
  	}
docs: Implements the same semantics as {@link CompletionService#take()}, except that the wait will
  periodically time out within this method to log a warning message that the thread appears
  stuck. This cycle will be repeated until a {@link Future} is obtained. If the thread has
  waited for an extended period, then wait logging is quiesced to avoid overwhelming the logs.
  If and when a thread that has been reported as being stuck finally does obtain a
  {@link Future}, then a warning level message is logged to indicate that the thread is
  resuming.
  
  @param <T>
  Generic type of the Future result
  @param cs
  the CompletionService to wait on
  @param callerClass
  the caller class
  @param callerMethod
  the caller method
  @param args
  extra arguments to be appended to the log message
  @return the Future<T> obtained from the CompletionService
  @throws InterruptedException