### Question:
BlueprintStateServiceImpl implements BlueprintStateService, BlueprintListener { @Override public BundleState getBundleState( long bundleId ) { BlueprintEvent blueprintEvent = states.get( bundleId ); if ( blueprintEvent == null ) { return BundleState.Unknown; } switch ( blueprintEvent.getType() ) { case BlueprintEvent.CREATING: return BundleState.Starting; case BlueprintEvent.CREATED: return BundleState.Active; case BlueprintEvent.DESTROYING: return BundleState.Stopping; case BlueprintEvent.DESTROYED: return BundleState.Resolved; case BlueprintEvent.FAILURE: return BundleState.Failure; case BlueprintEvent.GRACE_PERIOD: return BundleState.GracePeriod; case BlueprintEvent.WAITING: return BundleState.Waiting; default: return BundleState.Unknown; } } 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 testGetBundleState() { Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_UNKNOWN_ID ).equals( BundleState.Unknown ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_STARTING_ID ).equals( BundleState.Starting ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_ACTIVE_ID ).equals( BundleState.Active ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_STOPPING_ID ).equals( BundleState.Stopping ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_RESOLVED_ID ).equals( BundleState.Resolved ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_FAILURE_ID ).equals( BundleState.Failure ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_GRACE_PERIOD_ID ).equals( BundleState.GracePeriod ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_WAITING_ID ).equals( BundleState.Waiting ) ); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_NO_BLUEPRINT_ID ).equals( BundleState.Unknown ) ); bundleGracePeriodToFailed(); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_GRACE_PERIOD_ID ).equals( BundleState.Failure ) ); bundleStartingToActive(); Assert.assertTrue( blueprintStateServiceImpl.getBundleState( MOCK_BUNDLE_STARTING_ID ).equals( BundleState.Active ) ); }