private void callAndValidate() throws Exception {
      Exception exception = null;
      T retVal;
      int numRuns = 0;
      Stopwatch timeRun = Stopwatch.createStarted();

      try {
        do {
          numRuns++;
          retVal = callable.call();

          if (eventualExpectedValueSet && retVal.equals(expectedValue)) {
            return;
          }
        } while (eventualExpectedValueSet
            && ((iterations != DEFAULT_ITERATIONS && numRuns < iterations)
                || (timeRun.elapsed(SECONDS) <= duration.getSeconds())));

        if (expectedValue != null) {
          assertThat(retVal).isEqualTo(expectedValue);
        }
      } catch (Exception e) {
        exception = e;
      }

      if (expectedExceptionCauseType != null && expectedExceptionType != null) {
        assertThat(exception).isInstanceOf(expectedExceptionType)
            .hasCauseInstanceOf(expectedExceptionCauseType);
      } else if (expectedExceptionType != null) {
        assertThat(exception).isInstanceOf(expectedExceptionType);
      } else if (expectedExceptionCauseType != null) {
        assertThat(exception).hasCauseInstanceOf(expectedExceptionCauseType);
      } else if (expectedException != null) {
        checkThrown(exception, expectedException);
      } else {
        if (exception != null) {
          throw exception; // rethrow if we weren't expecting any exception and got one
        }
      }
    }
Sets the expected result of running the thread to be a value matching the given value

@param expectedValue the value expected to be returned from the thread. The value must
       implement equals
@return this, the ConcurrentOperation (containing a callable) that has been set to repeat
geode-junit/src/main/java/org/apache/geode/test/junit/rules/ConcurrencyRule.java