S, T> static method
source to be a
Any time the list would produce an element that is not a
the element access will throw.
Any time a
T value is attempted stored into the adapted list,
the store 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 list are actually instance
then the returned list can be used as a
Methods which accept
Object? as argument, like contains and remove,
will pass the argument directly to the this list's method
without any checks.
static List<T> castFrom<S, T>(List<S> source) => CastList<S, T>(source);