Package: java.util

## [Java] Interface Queue

-     public interface Queue

  GDK enhancements for Queue.

  displayName:
    Queue
  receiverFqcn:
    java.util.Queue

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T>` | `public Queue<T>` | `asChecked(Class<T> type)` Creates a checked view of a Queue.
    `<T>` | `public List<T>` | `drain()` Drain the queue of elements, returning them as a list.

- - ### Method Detail

    - #### <T> public Queue<T> asChecked(Class<T> type)

      Creates a checked view of a Queue.

      See Also:
        Collections.checkedQueue
      Since:
        5.0.0

    - #### <T> public List<T> drain()

      Drain the queue of elements, returning them as a list.

           def letters = new PriorityQueue(String.CASE_INSENSITIVE_ORDER)
           letters.addAll(['Z', 'y', 'X', 'a', 'B', 'c'])
           assert letters.toList() == ['a', 'B', 'c', 'Z', 'X', 'y']
           assert letters.drain() == ['a', 'B', 'c', 'X', 'y', 'Z']
           assert letters.empty

      Returns:
        a List of elements removed from the head of the queue
      Since:
        5.0.0