/**
  * Gets a service descriptor by ID, returning null if no such service exists.
  *
  * @param serviceId the service ID.
  * @return the service descriptor, or null.
  */
 private ServiceDescriptor getServiceDescriptor(String serviceId) {
   try {
     return serviceDescriptors.getDescriptor(Locale.getDefault(), serviceId);
   } catch (IllegalStateException e) {
     return null;
   }
 }
  public ServiceDescriptor getServiceDescriptor(String serviceId) {

    if (serviceId == null) {
      return null;
    }

    return serviceDescriptors.getDescriptor(Locale.getDefault(), serviceId);
  }