@ SneakyThrows @ SuppressWarnings ( "unchecked" ) public static < T > Collection < T > newServiceInstances ( final Class < T > service ) { Collection < T > result = new LinkedList <> ( ) ; if ( null == SERVICE_MAP . get ( service ) ) { return result ; } for ( Class < ? > each : SERVICE_MAP . get ( service ) ) { result . add ( ( T ) each . newInstance ( ) ) ; } return result ; }
New service instances .