@ SuppressWarnings ( "unchecked" ) public static < T > Set < T > asSet ( Class < T > itemType , T ... objects ) { LinkedHashSet < T > result = new LinkedHashSet < T > ( ) ; for ( T item : objects ) { result . add ( item ) ; } return result ; }
create a collection set with initial values .