code: public static <E> E takeUninterruptibly(BlockingQueue<E> queue) {
      boolean interrupted = false;
      try {
        while (true) {
          try {
            return queue.take();
          } catch (InterruptedException e) {
            interrupted = true;
          }
        }
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
docs: Invokes {@code queue.}{@link BlockingQueue#take() take()} uninterruptibly.