@SuppressWarnings("unchecked")
  public <S> List<PlatformService<S>> getServicesByType(ServiceType type) {

    // query the MBeanServer for all services of the given type
    Set<String> serviceNames = getServiceNames(type);

    List<PlatformService<S>> res = new ArrayList<PlatformService<S>>();
    for (String serviceName : serviceNames) {
      res.add((PlatformService<S>) servicesByName.get(getObjectName(serviceName)));
    }

    return res;
  }
@ SuppressWarnings ( "unchecked" ) public < S > List < PlatformService < S > > getServicesByType ( ServiceType type ) { Set < String > serviceNames = getServiceNames ( type ) ; List < PlatformService < S > > res = new ArrayList < PlatformService < S > > ( ) ; for ( String serviceName : serviceNames ) { res . add ( ( PlatformService < S > ) servicesByName . get ( getObjectName ( serviceName ) ) ) ; } return res ; }
@return all services for a specific {@link ServiceType}