@Override
      public Object call() throws Exception {
        InternalResourceManager irm = getCache().getInternalResourceManager();
        final ResourceAdvisor ra = irm.getResourceAdvisor();
        WaitCriterion wc = new WaitCriterion() {
          @Override
          public String description() {
            return "verify profiles failed. Current profiles: " + ra.adviseGeneric();
          }

          @Override
          public boolean done() {
            return numberOfProfiles == ra.adviseGeneric().size();
          }
        };
        Wait.waitForCriterion(wc, 10000, 10, true);
        return null;
      }
Verifies that the test listener value on the given vm is what is expected Note that for remote
events useWaitCriterion must be true. Note also that since off-heap local events are async
local events must also set useWaitCriterion to true.

@param vm the vm where verification should take place
@param value the expected value
@param useWaitCriterion must be true for both local and remote events (see GEODE-138)
geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsOffHeapDUnitTest.java