### Question:
EtcdMetaStore implements MetaStore { @Override public void register(long version) { etcdClient.put(String.format(SQL_NODE_PATH, serverID), ByteString.copyFrom(String.valueOf(version), StandardCharsets.UTF_8), true); }  @Override void init(JimConfig c); @Override int allocMetaID(); @Override long allocTaskID(TaskType type); @Override long addAndGetVersion(long incr); @Override long addAndGetPrivVersion(long incr); @Override void register(long version); @Override void unRegister(); @Override Map<String, Long> getRegisters(); @Override boolean storeCatalog(Metapb.CatalogInfo expect, Metapb.CatalogInfo catalogInfo); @Override boolean removeCatalog(int id); @Override Metapb.CatalogInfo getCatalog(int id); @Override List<Metapb.CatalogInfo> getCatalogs(); @Override boolean storeTable(Metapb.TableInfo expect, Metapb.TableInfo tableInfo); @Override boolean removeTable(int dbID, int tableID); @Override Metapb.TableInfo getTable(int catalogID, int tableID); @Override List<Metapb.TableInfo> getTables(int catalogID); @Override Map<Metapb.CatalogInfo, List<Metapb.TableInfo>> getCatalogAndTables(); @Override Metapb.AutoIdInfo getAutoIdInfo(int catalogID, int tableID); @Override Metapb.AutoIdInfo storeAutoIdInfo(int catalogID, int tableID, Metapb.AutoIdInfo autoIdInfo, Metapb.AutoIdInfo expect); @Override boolean storeTask(TaskType type, Task expect, Task... tasks); @Override Task getTask(TaskType type, Task task); @Override List<Task> getTasks(TaskType type, Task task); @Override void removeTask(TaskType type, long taskId); @Override boolean tryLock(TaskType type, Task task); @Override void unLock(TaskType type, Task task); @Override void watch(WatchType type, LongConsumer consumer); @Override void close();  }### Answer:
@Test public void registerTest() { HashMap<String, Long> etcdMetaStores = new HashMap<>(); List<EtcdMetaStore> metaStores = new ArrayList<>(); for (int i = 0; i < 10; i++) { EtcdMetaStore metaStore = new EtcdMetaStore(); Properties properties = IOUtil.loadResource("jim.properties"); JimConfig config = new JimConfig(properties); metaStore.init(config); metaStore.register(i); etcdMetaStores.put(SQL_NODE_LIST + metaStore.serverID, (long) i); metaStores.add(metaStore); } Map<String, Long> registers = metaStore.getRegisters(); registers.forEach((k, v) -> { Long version = etcdMetaStores.get(k); Assert.assertEquals(version, v); }); metaStores.forEach(e -> e.unRegister()); Map<String, Long> noRegisters = metaStore.getRegisters(); Assert.assertEquals(0, noRegisters.size()); }