code: public static <E> void putUninterruptibly(BlockingQueue<E> queue, E element) {
      boolean interrupted = false;
      try {
        while (true) {
          try {
            queue.put(element);
            return;
          } catch (InterruptedException e) {
            interrupted = true;
          }
        }
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
docs: Invokes {@code queue.}{@link BlockingQueue#put(Object) put(element)}
  uninterruptibly.
  
  @throws ClassCastException if the class of the specified element prevents
  it from being added to the given queue
  @throws IllegalArgumentException if some property of the specified element
  prevents it from being added to the given queue