code: public static <T> Iterator<T> iterator(Queue<T> queue)
      {
          return new XIteratorImpl<>(()->!queue.isEmpty(), queue::remove);
      }
docs: Returns Queue as iterator. Calls isEmpty and remove methods
  @param <T>
  @param queue
  @return