### Question:
ZooKeeperCoordinator extends ZooKeeperConnection implements Coordinator { @Override public Domain addDomain(String domainName, int numParts, String storageEngineFactoryName, String storageEngineOptions, String partitionerName, List<String> requiredHostFlags) throws IOException { try { ZkDomain domain = ZkDomain.create(zk, domainsRoot, domainName, numParts, storageEngineFactoryName, storageEngineOptions, partitionerName, getNextDomainId(), requiredHostFlags); domains.put(domainName, domain); return domain; } catch (Exception e) { throw new IOException(e); } } ZooKeeperCoordinator(String zkConnectString,
                       int sessionTimeoutMs,
                       String domainsRoot,
                       String domainGroupsRoot,
                       String ringGroupsRoot);  ZooKeeperCoordinator(String zkConnectString,
                              int sessionTimeoutMs,
                              String domainsRoot,
                              String domainGroupsRoot,
                              String ringGroupsRoot,
                              int maxConnectAttempts); @Override Domain getDomain(String domainName); @Override Domain getDomainShallow(String domainName); @Override Domain getDomainById(int domainId); @Override DomainGroup getDomainGroup(String domainGroupName); @Override RingGroup getRingGroup(String ringGroupName); @Override Set<Domain> getDomains(); @Override SortedSet<Domain> getDomainsSorted(); @Override Set<DomainGroup> getDomainGroups(); @Override SortedSet<DomainGroup> getDomainGroupsSorted(); @Override Set<RingGroup> getRingGroups(); @Override SortedSet<RingGroup> getRingGroupsSorted(); @Override Set<RingGroup> getRingGroupsForDomainGroup(DomainGroup domainGroup); @Override Domain addDomain(String domainName,
                          int numParts,
                          String storageEngineFactoryName,
                          String storageEngineOptions,
                          String partitionerName,
                          List<String> requiredHostFlags); @Override Domain updateDomain(String domainName,
                             int numParts,
                             String storageEngineFactoryClassName,
                             String storageEngineOptions,
                             String partitionerClassName,
                             List<String> requiredHostFlags); @Override DomainGroup addDomainGroup(String name); @Override RingGroup addRingGroup(String ringGroupName, String domainGroupName); @Override void close(); @Override String getDataState(); @Override String toString(); @Override boolean deleteDomain(String domainName); @Override boolean deleteDomainVersion(String domainName, int versionNumber); @Override boolean deleteDomainGroup(String domainGroupName); @Override boolean deleteRingGroup(String ringGroupName);  }### Answer:
@Test public void testAddDomain() throws Exception { coord.addDomain("myDomain", 1234, ConstantStorageEngine.Factory.class.getName(), "---", ConstantPartitioner.class.getName(), Collections.emptyList()); Domain domain = coord.getDomain("myDomain"); assertEquals(1, domain.getId()); assertNotNull(domain); assertEquals("myDomain", domain.getName()); assertEquals(1234, domain.getNumParts()); assertTrue(domain.getStorageEngine() instanceof ConstantStorageEngine); assertTrue(domain.getPartitioner() instanceof ConstantPartitioner); coord.addDomain("myDomain2", 1234, ConstantStorageEngine.Factory.class.getName(), "---", ConstantPartitioner.class.getName(), Collections.emptyList()); domain = coord.getDomain("myDomain2"); assertEquals(2, domain.getId()); assertNotNull(domain); assertEquals("myDomain2", domain.getName()); assertEquals(1234, domain.getNumParts()); assertTrue(domain.getStorageEngine() instanceof ConstantStorageEngine); assertTrue(domain.getPartitioner() instanceof ConstantPartitioner); }