S, T> static method
source to be a
Any time the queue would produce an element that is not a
the element access will throw.
T value is stored into the adapted queue,
the operation will throw unless the value is also an instance of
If all accessed elements of
source are actually instances of
and if all elements stored into the returned queue are actually instances
then the returned queue can be used as a
Methods which accept
Object? as argument, like contains and remove,
will pass the argument directly to this queue's method
without any checks.
static Queue<T> castFrom<S, T>(Queue<S> source) => CastQueue<S, T>(source);