@VisibleForTesting
  RemoteApplicationVM removeMember(InternalDistributedMember id) {
    Future future = null;
    synchronized (membersLock) {
      Map<InternalDistributedMember, Future<RemoteApplicationVM>> oldMembersMap = membersMap;
      if (oldMembersMap.containsKey(id)) {
        Map<InternalDistributedMember, Future<RemoteApplicationVM>> newMembersMap =
            new HashMap<>(oldMembersMap);
        future = newMembersMap.remove(id);
        if (future != null) {
          membersMap = newMembersMap;
        }
      }
    }

    if (future != null) {
      future.cancel(true);
      for (;;) {
        synchronized (systemLock) {
          if (system == null) {
            return null;
          }
          system.getCancelCriterion().checkCancelInProgress(null);
        }

        boolean interrupted = Thread.interrupted();
        try {
          return (RemoteApplicationVM) future.get();
        } catch (InterruptedException ex) {
          interrupted = true;
        } catch (CancellationException ex) {
          return null;
        } catch (ExecutionException ex) {
          handle(ex);
          return null;
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
      }
    }
    return null;
  }
Removes and returns the representation of the application VM member of the distributed system
with the given {@code id}.
geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java