@ SuppressWarnings ( "rawtypes" ) public static Collection createConcreteCollection ( Class interfaceType ) { Collection elements ; if ( interfaceType . equals ( List . class ) || interfaceType . equals ( Collection . class ) ) { elements = new ArrayList ( ) ; } else if ( interfaceType . equals ( SortedSet . class ) ) { elements = new TreeSet ( ) ; } else { elements = new HashSet ( ) ; } return elements ; }
Creates a concrete collection for the suppied interface