shadows/framework/src/main/java/org/robolectric/shadows/ShadowPackageManager.java
@Nullable
  public ServiceInfo removeService(ComponentName componentName) {
    return removeComponent(
        componentName, serviceFilters, p -> p.services, (p, a) -> p.services = a);
  }
@Nullable
  public ServiceInfo removeService(ComponentName componentName) {
    return removeComponent(
        componentName, serviceFilters, p -> p.services, (p, a) -> p.services = a);
  }
Removes service from the package manager.

@return the removed component or {@code null} if no such component existed.