public static < T > Set < T > dup ( Collection < T > collection ) { if ( isEmpty ( collection ) ) return new HashSet < T > ( ) ; return new HashSet < T > ( collection ) ; }
Duplicate set . This allow s the default Set implementation to be swapped easily .