### Question:
ManagedResourceHandler implements ResourceHandler { @Override public boolean hasManagedResources( Bundle bundle ) { try { return bundle.getResources( BUNDLE_MANAGED_RESOURCES_DIR ) != null; } catch ( IOException e ) { return false; } }  void setManagedResourceProvider( ResourceProvider resourceProvider ); @Override boolean hasManagedResources( Bundle bundle ); @Override void handleManagedResources( Bundle blueprintBundle ); static String BUNDLE_MANAGED_RESOURCES_DIR; }### Answer:
@Test public void testHasManagedResources() throws Exception { doReturn( mock( Enumeration.class ) ).when( bundle ) .getResources( ManagedResourceHandler.BUNDLE_MANAGED_RESOURCES_DIR ); assertTrue( resourceHandler.hasManagedResources( bundle ) ); }
@Test public void testDoesNotHaveManagedResources() throws Exception { doReturn( null ).when( bundle ).getResources( ManagedResourceHandler.BUNDLE_MANAGED_RESOURCES_DIR ); assertFalse( resourceHandler.hasManagedResources( bundle ) ); }