@Test
public void testGetState()
{

    List<Bundle> bundles = Lists.newArrayList( bundle );
    doReturn( bundles.toArray( new Bundle[0] ) ).when( bundleContext ).getBundles();
    assertEquals( HealthService.State.LOADING, healthRestService.getState() );
    doReturn( BundleState.Failure ).when( bundleStateService ).getState( bundle );
    for ( int i = 0; i <= HealthService.BUNDLE_COUNT; i++ )
    {
        bundles.add( bundle );
    }
    doReturn( bundles.toArray( new Bundle[0] ) ).when( bundleContext ).getBundles();
    assertEquals( HealthService.State.FAILED, healthRestService.getState() );
    doReturn( BundleState.Active ).when( bundleStateService ).getState( bundle );
    assertEquals( HealthService.State.READY, healthRestService.getState() );
}