public static Set<Role> waitForRequiredRoles(Region<?, ?> region, long timeout)
      throws InterruptedException {
    if (region == null) {
      throw new NullPointerException(
          "Region must be specified");
    }
    if (!(region instanceof DistributedRegion)) {
      throw new IllegalStateException(
          "Region has not been configured with required roles.");
    }
    DistributedRegion dr = (DistributedRegion) region;
    return dr.waitForRequiredRoles(timeout);
  }
Returns a set of any currently missing required roles for the specified region. This will wait
the specified timeout in milliseconds for any missing required roles to be filled. If there are
no missing required roles or if the region is not configured to require any roles then an empty
set will immediately be returned.

@param region the region to check for missing required roles
@param timeout milliseconds to wait for any missing required roles
@return set of required roles that are currently missing
@throws NullPointerException if region is null
@throws InterruptedException if thread is interrupted while waiting
@throws IllegalStateException if region is not configured with required roles
geode-core/src/main/java/org/apache/geode/cache/RequiredRoles.java