@Test
  public void testBug35945() throws Exception {
    PORT1 = server1.invoke(HAInterestTestCase::createServerCache);
    server1.invoke(HAInterestTestCase::createEntriesK1andK2);
    createClientPoolCacheConnectionToSingleServer(getName(),
        getServerHostName(server1.getHost()));
    registerK1AndK2();
    verifyRefreshedEntriesFromServer();

    server1.invoke(HAInterestTestCase::stopServer);
    verifyDeadAndLiveServers(1, 0);
    // put on stopped server
    server1.invoke(HAInterestTestCase::putK1andK2);
    // spawn a thread to put on server , which will acquire a lock on entry
    setClientServerObserverForBeforeInterestRecovery();
    server1.invoke(HAInterestTestCase::startServer);
    verifyDeadAndLiveServers(0, 1);
    waitForBeforeInterestRecoveryCallBack();
    // verify updated value of k1 as a refreshEntriesFromServer
    final Region r1 = cache.getRegion(SEPARATOR + REGION_NAME);
    assertNotNull(r1);

    WaitCriterion wc = new WaitCriterion() {
      private String excuse;

      @Override
      public boolean done() {
        Entry e1 = r1.getEntry(k1);
        Entry e2 = r1.getEntry(k2);
        Object v1 = null;
        if (e1 != null) {
          try {
            v1 = e1.getValue();
          } catch (EntryDestroyedException ignore) {
            // handled to fix GEODE-296
          }
        }
        if (e1 == null || !server_k1_updated.equals(v1)) {
          excuse = "v1=" + v1;
          return false;
        }
        Object v2 = null;
        if (e2 != null) {
          try {
            v2 = e2.getValue();
          } catch (EntryDestroyedException ignore) {
            // handled to fix GEODE-296
          }
        }
        if (e2 == null || !server_k2.equals(v2)) {
          excuse = "v2=" + v2;
          return false;
        }
        return true;
      }

      @Override
      public String description() {
        return excuse;
      }
    };
    GeodeAwaitility.await().untilAsserted(wc);
  }
Bug Test for Bug # 35945 A java level Deadlock between acquireConnection and RegionEntry during
processRecoveredEndpoint by Dead Server Monitor Thread.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/HAInterestPart2DUnitTest.java