@Override
    public void run() {
      try {
        System.out.println("--------------------- Populating Data -------------------------");
        for (int i = 0; i < 10; i++) {
          region.put(String.valueOf(i), new Portfolio(i));
          Portfolio value = (Portfolio) region.get(String.valueOf(i));
          CacheUtils.log("value for key " + i + " is: " + value);
          CacheUtils.log("region.size(): - " + region.size());
        }
        System.out.println("--------------------- Data Populatio done -------------------------");

        System.out.println(
            "---------------------Destroying & repopulating the data -------------------------");
        AttributesMutator mutator =
            region.getAttributesMutator();
        mutator.setCacheWriter(new BeforeUpdateCallBack());
        CacheUtils.log("region.size(): - " + region.size());
        for (int i = 0; i < 10; i++) {
          region.destroy(String.valueOf(i));
          region.put(String.valueOf(i), new Portfolio(i + 20));
        }
      } catch (Exception e) {
        e.printStackTrace();
        testFailed = true;
        cause = "Test failed because of exception=" + e;
      }
    }
thread to put the entries in region
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/IndexCreationDeadLockJUnitTest.java