@Test
public void testGetConfigAsInt() throws Exception {

  final Hashtable<String, String> h = new Hashtable<>();
  h.put("a", "");
  h.put("b", "2");
  h.put("c", "d");
  try {
    OsgiUtil.getCfgAsInt(h, "a");
    Assert.fail();
  } catch (org.osgi.service.cm.ConfigurationException e) {
    Assert.assertNotNull(e);
  }
  assertEquals(2, OsgiUtil.getCfgAsInt(h, "b"));
  try {
    OsgiUtil.getCfgAsInt(h, "c");
    Assert.fail();
  } catch (org.osgi.service.cm.ConfigurationException e) {
    Assert.assertNotNull(e);
  }
}