code: public void check() throws InterruptedException, ExecutionException {
          // If a thread threw an uncaught exception, re-throw it.
          final ExecutionException executionException = getExecutionException();
          if (executionException != null) {
              throw executionException;
          }
          // If this thread or another thread has been interrupted, throw InterruptedException
          if (checkAndReturn()) {
              throw new InterruptedException();
          }
      }
docs: Check if this thread or any other thread that shares this InterruptionChecker instance has been interrupted
  or has thrown an exception, and if so, throw InterruptedException.
  
  @throws InterruptedException
  If a thread has been interrupted.
  @throws ExecutionException
  if a thread has thrown an uncaught exception.