### Question:
ZkMetadataStoreDirectory implements MetadataStoreDirectory, RoutingDataListener { @Override public boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData) { if (!_routingDataWriterMap.containsKey(namespace)) { throw new IllegalArgumentException( "Failed to set routing data: Namespace " + namespace + " is not found!"); } synchronized (this) { if (!_routingDataWriterMap.get(namespace).setRoutingData(routingData)) { return false; } refreshRoutingData(namespace); return true; } } @VisibleForTesting protected  ZkMetadataStoreDirectory(); static ZkMetadataStoreDirectory getInstance(); static ZkMetadataStoreDirectory getInstance(String namespace, String zkAddress); @Override Collection<String> getAllNamespaces(); @Override Collection<String> getAllMetadataStoreRealms(String namespace); @Override Collection<String> getAllShardingKeys(String namespace); @Override Map<String, List<String>> getNamespaceRoutingData(String namespace); @Override boolean setNamespaceRoutingData(String namespace, Map<String, List<String>> routingData); @Override Collection<String> getAllShardingKeysInRealm(String namespace, String realm); @Override Map<String, String> getAllMappingUnderPath(String namespace, String path); @Override String getMetadataStoreRealm(String namespace, String shardingKey); @Override boolean addMetadataStoreRealm(String namespace, String realm); @Override boolean deleteMetadataStoreRealm(String namespace, String realm); @Override boolean addShardingKey(String namespace, String realm, String shardingKey); @Override boolean deleteShardingKey(String namespace, String realm, String shardingKey); @Override void refreshRoutingData(String namespace); @Override synchronized void close(); static void createRoutingDataPath(HelixZkClient zkClient, String zkAddress);  }### Answer:
@Test(dependsOnMethods = "testGetNamespaceRoutingData") public void testSetNamespaceRoutingData() { Map<String, List<String>> routingDataMap = new HashMap<>(); routingDataMap.put(TEST_REALM_1, TEST_SHARDING_KEYS_2); routingDataMap.put(TEST_REALM_2, TEST_SHARDING_KEYS_1); for (String namespace : _routingZkAddrMap.keySet()) { Assert.assertTrue(_metadataStoreDirectory.setNamespaceRoutingData(namespace, routingDataMap)); Assert .assertEquals(_metadataStoreDirectory.getNamespaceRoutingData(namespace), routingDataMap); } Map<String, List<String>> originalRoutingDataMap = new HashMap<>(); originalRoutingDataMap.put(TEST_REALM_1, TEST_SHARDING_KEYS_1); originalRoutingDataMap.put(TEST_REALM_2, TEST_SHARDING_KEYS_2); for (String namespace : _routingZkAddrMap.keySet()) { Assert.assertTrue( _metadataStoreDirectory.setNamespaceRoutingData(namespace, originalRoutingDataMap)); Assert.assertEquals(_metadataStoreDirectory.getNamespaceRoutingData(namespace), originalRoutingDataMap); } }