CloudantServiceInfoCreator extends CloudFoundryServiceInfoCreator<CloudantServiceInfo> { @Override public boolean accept(final Map<String, Object> serviceData) { boolean result = false; Object obj = serviceData.get("label"); if (obj instanceof String) { String label = (String) obj; result = "cloudantNoSQLDB".equals(label); } return result; } CloudantServiceInfoCreator(); @Override boolean accept(final Map<String, Object> serviceData); @Override CloudantServiceInfo createServiceInfo(final Map<String, Object> serviceData);  }
@Test public void testAcceptMapOfStringObject() { Map<String, Object> emptyProps = new HashMap<String, Object>(); Map<String, Object> stringProps = new HashMap<String, Object>(); stringProps.put("label", "cloudantNoSQLDB"); Map<String, Object> intProps = new HashMap<String, Object>(); intProps.put("label", 123); assertFalse(creator.accept(emptyProps)); assertFalse(creator.accept(intProps)); assertTrue(creator.accept(stringProps)); }