public static DistributedRegionMXBean getDistributedRegionMbean(final String regionName,
      final int expectedMembers) {
    DistributedRegionMXBean bean = null;

    final ManagementService service = ManagementTestBase.getManagementService();

    Wait.waitForCriterion(new WaitCriterion() {

      DistributedRegionMXBean bean = null;

      @Override
      public String description() {
        return "Waiting for " + regionName + " With " + expectedMembers
            + " proxies to get reflected at managing node";
      }

      @Override
      public boolean done() {
        GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
        bean = service.getDistributedRegionMXBean(regionName);

        boolean done = (bean != null && bean.getMemberCount() == expectedMembers);
        return done;
      }

    }, MAX_WAIT, 1000, true);

    bean = service.getDistributedRegionMXBean(regionName);
    return bean;
  }
Utility Method to obtain DistributedRegionMXBean proxy reference for a particular region

@param regionName name of the region
@param expectedMembers the number of members expected to be hosting the region
@return a reference to DistributedRegionMXBean
geode-dunit/src/main/java/org/apache/geode/management/MBeanUtil.java