@Override
        public Void call() throws Exception {
          // each thread gets its own ObjectStore to simulate threadLocal store
          ObjectStore objectStore = new ObjectStore();
          barrier.await();
          for (int j = 0; j < numIteration; j++) {
            // set connectionPool to a random value to increase the likelihood of pmf
            // re-initialization
            int randomNumber = random.nextInt(100);
            if (randomNumber % 2 == 0) {
              objectStore.setConf(conf);
            } else {
              Assert.assertNotNull(objectStore.getPersistenceManager());
            }
            counter.getAndIncrement();
          }
          return null;
        }
This test calls ObjectStore.setConf methods from multiple threads. Each threads uses its
own instance of ObjectStore to simulate thread-local objectstore behaviour.
@throws Exception
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java