private boolean isInterestListRegisteredToServer1() {
    /*
     * try { server1.invoke(() ->
     * InterestListRecoveryDUnitTest.verifyRegionToProxyMapForFullRegistration()); } catch
     * (Throwable t) { // Means its registered on server2. return false; } return true;
     */
    // check whether the primary endpoint is connected to server1 or server2
    try {
      Region<?, ?> r1 = cache.getRegion(SEPARATOR + REGION_NAME);
      String poolName = r1.getAttributes().getPoolName();
      assertNotNull(poolName);
      pool = (PoolImpl) PoolManager.find(poolName);
      assertNotNull(pool);
      return (pool.getPrimaryPort() == PORT1);
    } catch (Exception ex) {
      Assert.fail("while isInterestListRegisteredToServer1", ex);
    }
    // never reached
    return false;
  }
Test Scenario :

one client(c1) two servers(s1,s2) s1,s2 ----> available c1: register k1,k2,k3,k4,k5 s1 ---->
unavailable // fail over should happen to server s2 see all keys k1,k2,k3,k4,k5 are registered on
s2 c1: unregister k1,k2,k3 see interest list on s1 contains only s4, s5 s2 ----> unavaliable //
fail over should to s1 with intrest list s4,s5 see only k4 and k5 are registerd on s1
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java