### Question:
BlueprintStateServiceImpl implements BlueprintStateService, BlueprintListener { @Override public Boolean isBlueprintFailed( long bundleId ) { return hasBlueprint( bundleId ) && getBundleState( bundleId ) == BundleState.Failure; } 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 testIsBlueprintFailed() { Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_UNKNOWN_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_STARTING_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_ACTIVE_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_STOPPING_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_RESOLVED_ID ) ); Assert.assertTrue( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_FAILURE_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_GRACE_PERIOD_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_WAITING_ID ) ); Assert.assertFalse( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_NO_BLUEPRINT_ID ) ); bundleGracePeriodToFailed(); Assert.assertTrue( blueprintStateServiceImpl.isBlueprintFailed( MOCK_BUNDLE_GRACE_PERIOD_ID ) ); }