### Question:
ZooKeeperCoordinator extends ZooKeeperConnection implements Coordinator { @Override public RingGroup addRingGroup(String ringGroupName, String domainGroupName) throws IOException { try { RingGroup rg = ZkRingGroup.create(zk, ZkPath.append(ringGroupsRoot, ringGroupName), (ZkDomainGroup)getDomainGroup(domainGroupName), this); ringGroups.put(ringGroupName, (ZkRingGroup)rg); return rg; } 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 testAddRingGroup() throws Exception { DomainGroup dg = coord.addDomainGroup("myDomainGroup2"); Map<Domain, Integer> domainIdToVersion = new HashMap<>(); dg.setDomainVersions(domainIdToVersion); RingGroup rg = coord.addRingGroup("superDuperRingGroup", "myDomainGroup2"); assertEquals("superDuperRingGroup", rg.getName()); assertEquals(0, rg.getRings().size()); }