### Question:
BlueprintStateServiceImpl implements BlueprintStateService, BlueprintListener { @Override public Boolean hasBlueprint( long bundleId ) { if ( bluePrints.size() == 0 ) { for ( Bundle bundle : bundleContext.getBundles() ) { if ( bundle.getBundleId() == 0 ) { continue; } if ( bundle.getResource( "OSGI-INF/blueprint" ) != null ) { bluePrints.add( bundle.getBundleId() ); } } } return bluePrints.contains( bundleId ); } BlueprintStateServiceImpl( BundleContext bundleContext ); @Override Boolean isBlueprintLoaded( long bundleId ); @Override Boolean isBlueprintFailed( long bundleId ); @Override Boolean isBlueprintTryingToLoad( long bundleId ); @Override Boolean hasBlueprint( long bundleId ); @Override void blueprintEvent( BlueprintEvent blueprintEvent ); @Override BundleState getBundleState( long bundleId ); @Override String[] getBundleMissDependencies( long bundleId ); @Override Throwable getBundleFailureCause( long bundleId );  }### Answer:
@Test public void testHasBlueprint() { Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_UNKNOWN_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_STARTING_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_ACTIVE_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_STOPPING_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_RESOLVED_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_FAILURE_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_GRACE_PERIOD_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_WAITING_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.hasBlueprint( MOCK_BUNDLE_NO_BLUEPRINT_ID ) ); }