@Test
public void testIsBundleRequiredByOthers() throws Exception {

    
    Bundle bundle = mock(Bundle.class);
    when(bundle.getSymbolicName()).thenReturn("org.apache.testb");
    
    RequiredBundle reqBundle = mock(RequiredBundle.class);
    when(reqBundle.getBundle()).thenReturn(bundle);
    when(reqBundle.getRequiringBundles()).thenReturn(new Bundle[0]);
    
    PackageAdmin admin = mock(PackageAdmin.class);
    when(admin.getRequiredBundles("org.apache.testb")).thenReturn(new RequiredBundle[] { reqBundle });
    
    assertFalse(isBundleRequiredByOthers(bundle, admin));
    
    Bundle user = mock(Bundle.class);
    when(reqBundle.getRequiringBundles()).thenReturn(new Bundle[] { user });
    
    assertTrue(isBundleRequiredByOthers(bundle, admin));
}