### Question:
HaDescriptorFactory implements HaServiceConfigConstants { public static HaServiceConfig createServiceConfig(String serviceName, String config) { Map<String, String> configMap = parseHaConfiguration(config); String enabledValue = configMap.get(CONFIG_PARAM_ENABLED); String maxFailoverAttempts = configMap.get(CONFIG_PARAM_MAX_FAILOVER_ATTEMPTS); String failoverSleep = configMap.get(CONFIG_PARAM_FAILOVER_SLEEP); String zookeeperEnsemble = configMap.get(CONFIG_PARAM_ZOOKEEPER_ENSEMBLE); String zookeeperNamespace = configMap.get(CONFIG_PARAM_ZOOKEEPER_NAMESPACE); return createServiceConfig(serviceName, enabledValue, maxFailoverAttempts, failoverSleep, zookeeperEnsemble, zookeeperNamespace); }  static HaDescriptor createDescriptor(); static HaServiceConfig createServiceConfig(String serviceName, String config); static HaServiceConfig createServiceConfig(String serviceName, String enabledValue,
                                                     String maxFailoverAttemptsValue, String failoverSleepValue,
                                                     String zookeeperEnsemble, String zookeeperNamespace);  }### Answer:
@Test public void testCreateServiceConfig() { HaServiceConfig serviceConfig = HaDescriptorFactory.createServiceConfig("foo", "enabled=true;maxFailoverAttempts=42;failoverSleep=50"); assertNotNull(serviceConfig); assertTrue(serviceConfig.isEnabled()); assertEquals("foo", serviceConfig.getServiceName()); assertEquals(42, serviceConfig.getMaxFailoverAttempts()); assertEquals(50, serviceConfig.getFailoverSleep()); serviceConfig = HaDescriptorFactory.createServiceConfig("bar", "false", "3", "1000", null, null); assertNotNull(serviceConfig); assertFalse(serviceConfig.isEnabled()); assertEquals("bar", serviceConfig.getServiceName()); assertEquals(3, serviceConfig.getMaxFailoverAttempts()); assertEquals(1000, serviceConfig.getFailoverSleep()); }