### Question:
OsgiUtil { public static boolean containsBean(Object beanFactory, String beanId) { try { Method getBeanMethod = beanFactory.getClass().getMethod("containsBean", String.class); return (Boolean) getBeanMethod.invoke(beanFactory, beanId); } catch (Exception ex) { LOG.error("Unable to call containsBean() on object of type [{}], with bean id [{}]", beanFactory.getClass().getName(), beanId, ex); } return false; }  static URL translateBundleURLToJarURL(URL bundleUrl, Bundle bundle); static Object getBean(Object beanFactory, String beanId); static boolean containsBean(Object beanFactory, String beanId); static String generateJavaVersionForSystemPackages(String systemJavaVersion); static String generateJava_SE_SystemPackageVersionString(String systemJavaVersion);  }### Answer:
@Test public void testContainsBean() { MockBeanFactory mockBeanFactory = new MockBeanFactory(); Assert.assertTrue("OsgiUtil containsBean() on mock bean factory with numeric id is false ?", OsgiUtil.containsBean(mockBeanFactory, "1000")); Assert.assertFalse("OsgiUtil containsBean() on mock bean factory with nonnumeric id is true ?", OsgiUtil.containsBean(mockBeanFactory, "NotANumber")); Assert.assertFalse("OsgiUtil containsBean() on mock bean factory with null id is true ?", OsgiUtil.containsBean(mockBeanFactory, null)); }