public static < E , C extends Collection < E > > UnmodifiableMutableCollection < E > of ( C collection ) { if ( collection == null ) { throw new IllegalArgumentException ( "cannot create a UnmodifiableMutableCollection for null" ) ; } return new UnmodifiableMutableCollection < E > ( CollectionAdapter . adapt ( collection ) ) ; }
This method will take a MutableCollection and wrap it directly in a UnmodifiableMutableCollection . It will take any other non - GS - collection and first adapt it will a CollectionAdapter and then return a UnmodifiableMutableCollection that wraps the adapter .