### Question:
OSGIPluginRegistryExtension implements PluginRegistryExtension { @Override public String getPluginId( Class<? extends PluginTypeInterface> pluginType, Object pluginClass ) { try { return (String) tracker.getBeanPluginProperty( pluginType, pluginClass, "ID" ); } catch ( Exception e ) { logger.error( e.getMessage(), e ); } return null; } OSGIPluginRegistryExtension(); static OSGIPluginRegistryExtension getInstance(); KarafBoot getKarafBoot(); synchronized void init( final PluginRegistry registry ); @Override void searchForType( PluginTypeInterface pluginType ); @Override String getPluginId( Class<? extends PluginTypeInterface> pluginType, Object pluginClass );  }### Answer:
@Test public void testGetPluginId() { Object pluginClass = mock( Object.class ); String id = "TEST_ID"; when( tracker.getBeanPluginProperty( OSGIPluginType.class, pluginClass, "ID" ) ).thenReturn( id ); assertEquals( id, OSGIPluginRegistryExtension.getInstance().getPluginId( OSGIPluginType.class, pluginClass ) ); }