### Question:
OSGIServiceTracker extends ServiceTracker { @Override public void removedService( ServiceReference reference, Object service ) { references.remove( reference ); try { notifySuperOfRemoval( reference, service ); } catch ( IllegalStateException ignored ) { } tracker.serviceChanged( clazzToTrack, LifecycleEvent.STOP, reference ); } OSGIServiceTracker( OSGIPluginTracker tracker, Class clazzToTrack );  OSGIServiceTracker( OSGIPluginTracker osgiPluginTracker, Class clazzToTrack, boolean asPluginInterface ); @Override Object addingService( ServiceReference
                                 reference ); @Override void removedService( ServiceReference
                                reference, Object service ); @Override void modifiedService( ServiceReference
                                 reference, Object service );  }### Answer:
@Test public void testRemovedService() { ServiceReference serviceReference = mock( ServiceReference.class ); Object service = mock( Object.class ); new OSGIServiceTracker( pluginTracker, Object.class ).removedService( serviceReference, service ); verify( pluginTracker ).serviceChanged( Object.class, STOP, serviceReference ); verify( bundleContext ).ungetService( serviceReference ); }