### Question:
PentahoWebPackageServiceTracker implements ServiceTrackerCustomizer<IPentahoWebPackage, ServiceRegistration<?>> { @Override public void removedService( ServiceReference<IPentahoWebPackage> reference, ServiceRegistration<?> serviceRegistration ) { this.context.ungetService( reference ); try { serviceRegistration.unregister(); } catch ( RuntimeException ignored ) { } } PentahoWebPackageServiceTracker( BundleContext context ); @Override ServiceRegistration<?> addingService( ServiceReference<IPentahoWebPackage> reference ); @Override void modifiedService( ServiceReference<IPentahoWebPackage> reference, ServiceRegistration<?> serviceRegistration ); @Override void removedService( ServiceReference<IPentahoWebPackage> reference, ServiceRegistration<?> serviceRegistration );  }### Answer:
@Test public void removedService() { ServiceRegistration serviceRegistration = this.pentahoWebPackageServiceTracker.addingService( mockServiceReference ); this.pentahoWebPackageServiceTracker.removedService( this.mockServiceReference, serviceRegistration ); verify( mockBundleContext, times( 1 ) ).ungetService( any() ); verify( serviceRegistration, times( 1 ) ).unregister(); }