public static Set<DistributedMember> getAllMembers(InternalCache cache) {
    return getAllMembers(cache.getInternalDistributedSystem());
  }
Returns a set of all the members of the distributed system including locators.
geode-core/src/main/java/org/apache/geode/management/internal/util/ManagementUtils.java