Buggy code:
protected void assertLocation ( String expected , String actual ) { } protected void assertLocation ( String expected , Subsystem subsystem ) { } protected void assertNotChild ( Subsystem parent , Subsystem child ) { } protected void assertNotConstituent ( Subsystem subsystem , String symbolicName ) { } protected void assertNotConstituent ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected void assertParent ( Subsystem expected , Subsystem subsystem ) { } protected void assertProvisionPolicy ( Subsystem subsystem , boolean acceptsDependencies ) { } protected void assertRefresh ( Collection < Bundle > bundles ) throws InterruptedException { } protected void assertRefreshAndResolve ( Collection < Bundle > bundles ) throws InterruptedException { } protected void assertRegionContextBundle ( Subsystem s ) { } protected void assertResolve ( Collection < Bundle > bundles ) { } protected void assertServiceEventsInstall ( Subsystem subsystem ) throws InterruptedException { } protected void assertServiceEventsResolve ( Subsystem subsystem ) throws InterruptedException { } protected void assertServiceEventsStart ( Subsystem subsystem ) throws InterruptedException { } protected void assertServiceEventsStop ( Subsystem subsystem ) throws InterruptedException { } protected void assertServiceEventResolved ( Subsystem subsystem , int type ) throws InterruptedException { } protected void assertStartLevel ( Bundle bundle , int expected ) { } protected void assertState ( State expected , State actual ) { } protected void assertState ( EnumSet < State > expected , State actual ) { } protected void assertState ( State expected , Subsystem subsystem ) { } protected void assertState ( EnumSet < State > expected , Subsystem subsystem ) { } protected Subsystem assertSubsystemLifeCycle ( File file ) throws Exception { } protected void assertSubsystemNotNull ( Subsystem subsystem ) { } protected void assertSymbolicName ( String expected , Subsystem subsystem ) { } protected void assertSymbolicName ( String expected , String actual ) { } protected void assertType ( String expected , Subsystem subsystem ) { } protected void assertVersion ( String expected , Subsystem subsystem ) { } protected void assertVersion ( Version expected , Subsystem subsystem ) { } protected void assertVersion ( Version expected , Version actual ) { } protected static void createBundle ( String symbolicName ) throws IOException { } protected static void createBundle ( String symbolicName , Map < String , String > headers ) throws IOException { } protected static void createBundle ( String symbolicName , String version , Map < String , String > headers ) throws IOException { } protected static void createBundle ( Map < String , String > headers ) throws IOException { } protected RepositoryContent createBundleRepositoryContent ( String file ) throws Exception { } protected RepositoryContent createBundleRepositoryContent ( File file ) throws Exception { } protected static void createManifest ( String name , Map < String , String > headers ) throws IOException { } protected static void createSubsystem ( String name ) throws IOException { } protected static void createSubsystem ( String name , String ... contents ) throws IOException { } protected Subsystem findSubsystemService ( long id ) throws InvalidSyntaxException { } protected Bundle getBundle ( Subsystem subsystem , String symbolicName ) { } protected Subsystem getChild ( Subsystem parent , String symbolicName ) { } protected Subsystem getChild ( Subsystem parent , String symbolicName , Version version ) { } protected Subsystem getChild ( Subsystem parent , String symbolicName , Version version , String type ) { } protected Resource getConstituent ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected AriesSubsystem getConstituentAsAriesSubsystem ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected Bundle getConstituentAsBundle ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected BundleRevision getConstituentAsBundleRevision ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected Subsystem getConstituentAsSubsystem ( Subsystem subsystem , String symbolicName , Version version , String type ) { } protected Region getRegion ( Subsystem subsystem ) { } protected Bundle getRegionContextBundle ( Subsystem subsystem ) { } protected AriesSubsystem getRootAriesSubsystem ( ) { } protected Subsystem getRootSubsystem ( ) { <START_BUG> return getOsgiService ( Subsystem . class ) ; <END_BUG> } protected Subsystem getRootSubsystemInState ( Subsystem . State state , long timeout ) throws InterruptedException { } protected Bundle getSystemBundle ( ) { } protected FrameworkStartLevel getSystemBundleAsFrameworkStartLevel ( ) { } protected FrameworkWiring getSystemBundleAsFrameworkWiring ( ) { } protected Bundle getSubsystemCoreBundle ( ) { } protected Bundle installBundleFromFile ( String fileName ) throws FileNotFoundException , BundleException { } protected Bundle installBundleFromFile ( File file ) throws FileNotFoundException , BundleException { } protected Bundle installBundleFromFile ( String file , Subsystem subsystem ) throws FileNotFoundException , BundleException { } protected Bundle installBundleFromFile ( File file , Subsystem subsystem ) throws FileNotFoundException , BundleException { } protected Bundle installBundleFromFile ( File file , BundleContext bundleContext ) throws FileNotFoundException , BundleException { } protected Subsystem installSubsystemFromFile ( Subsystem parent , String fileName ) throws Exception { } protected Subsystem installSubsystemFromFile ( String fileName ) throws Exception { } protected Subsystem installSubsystemFromFile ( Subsystem parent , File file ) throws Exception { } protected Subsystem installSubsystemFromFile ( File file ) throws Exception { } protected Subsystem installSubsystem ( String location ) throws Exception { } protected Subsystem installSubsystem ( String location , InputStream content ) throws Exception { } protected Subsystem installSubsystem ( Subsystem parent , String location ) throws Exception { } protected Subsystem installSubsystem ( Subsystem parent , String location , InputStream content ) throws Exception { } protected void registerRepositoryService ( Repository repository ) { } protected void registerRepositoryService ( Resource ... resources ) { } protected void registerRepositoryService ( String ... files ) throws Exception { } protected void restartSubsystemsImplBundle ( ) throws BundleException { } protected void startBundle ( Bundle bundle ) throws BundleException { } protected void startBundle ( Bundle bundle , Subsystem subsystem ) throws BundleException { } protected void startSubsystem ( Subsystem subsystem ) throws Exception { }

Fix:
return getOsgiService ( Subsystem . class , "(&(objectClass=org.osgi.service.subsystem.Subsystem)(subsystem.id=0))" , DEFAULT_TIMEOUT ) ;