| Factory method to create a typed bag.
If there are any elements already in the bag being decorated, they
are validated.
Parameters: bag - the bag to decorate, must not be null Parameters: type - the type to allow into the bag, must not be null a new typed Bag throws: IllegalArgumentException - if bag or type is null throws: IllegalArgumentException - if the bag contains invalid elements |