@Test
  public void testWaitForViewInstallation() {
    InternalDistributedSystem system = getSystem();
    ClusterDistributionManager dm = (ClusterDistributionManager) system.getDM();
    MembershipView<InternalDistributedMember> view = dm.getDistribution().getView();

    AtomicBoolean waitForViewInstallationDone = new AtomicBoolean();
    executorService.submit(() -> {
      try {
        dm.waitForViewInstallation(view.getViewId() + 1);
        waitForViewInstallationDone.set(true);
      } catch (InterruptedException e) {
        errorCollector.addError(e);
      }
    });

    pause(2000);

    vm1.invoke("create another member to initiate a new view", () -> {
      getSystem();
    });

    await()
        .untilAsserted(() -> assertThat(waitForViewInstallationDone.get()).isTrue());
  }
install a new view and show that waitForViewInstallation works as expected
geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java