  @Test
  public void watchTest() throws InterruptedException {

    int parallel = 16;
    CountDownLatch latch = new CountDownLatch(parallel);
    ConcurrentHashMap<Integer, EtcdMetaStore> storeMap = new ConcurrentHashMap();

    for (int i = 0; i < parallel; i++) {
      EtcdMetaStore metaStore = new EtcdMetaStore();
      Properties properties = IOUtil.loadResource("jim.properties");
      JimConfig config = new JimConfig(properties);
      metaStore.init(config);
      storeMap.put(i, metaStore);
    }

    storeMap.forEach((k, v) -> {
      Thread t = new Thread(() -> {
        v.watch(MetaStore.WatchType.SCHEMAVERSION, value -> Assert.assertEquals(value, 0));
        latch.countDown();
      });
      t.start();
    });
    latch.await();

    for (int i = 0; i < parallel; i++) {
      metaStore.addAndGetVersion(1);
    }
    TimeUnit.SECONDS.sleep(10);
  }