code: @SuppressWarnings("javadoc")
      public static <T> T getSingleService(Class<T> serviceInterface) throws IllegalStateException {
          // Cached single service values are derived from the values cached when checking
          // for multiple services
          T rval = null;
          Set<T> services = getServices(serviceInterface);
          
          if (services.size() > 1) {
              throw new IllegalStateException("Multiple implementations found of " + serviceInterface); //$NON-NLS-1$
          } else if (!services.isEmpty()) {
              rval = services.iterator().next();
          }
          return rval;
      }
docs: Gets a single service by its interface.
  @param serviceInterface the service interface
  @throws IllegalStateException method has been invoked at an illegal or inappropriate time