### Question:
ZooKeeperCoordinator extends ZooKeeperConnection implements Coordinator { @Override public DomainGroup addDomainGroup(String name) throws IOException { try { ZkDomainGroup dgc = ZkDomainGroup.create(zk, this, domainGroupsRoot, name); synchronized (domainGroups) { domainGroups.put(name, dgc); } return dgc; } 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 testAddDomainGroup() throws Exception { final ZooKeeperCoordinator coord2 = getCoord(); coord.addDomainGroup("myDomainGroup2"); DomainGroup c = coord.getDomainGroup("myDomainGroup2"); assertNotNull(c); assertEquals("myDomainGroup2", c.getName()); assertEquals(0, c.getDomainVersions().size()); WaitUntil.orDie(() -> coord2.getDomainGroup("myDomainGroup2") != null); assertNotNull("myDomainGroup2 should be found", c); assertEquals("myDomainGroup2", c.getName()); assertEquals(0, c.getDomainVersions().size()); coord2.close(); }