@Override
 public void runTests(
     final TestExecutionRequest testExecutionRequest,
     ConsumerOperationParameters operationParameters) {
   final BuildCancellationTokenAdapter cancellationTokenAdapter =
       new BuildCancellationTokenAdapter(operationParameters.getCancellationToken());
   ((InternalTestExecutionConnection) getDelegate())
       .runTests(testExecutionRequest, cancellationTokenAdapter, operationParameters);
 }
    public <T> T run(final BuildAction<T> action, ConsumerOperationParameters operationParameters)
        throws UnsupportedOperationException, IllegalStateException {
      BuildResult<T> result;

      File rootDir = operationParameters.getProjectDir();
      try {
        result =
            executor.run(new InternalBuildActionAdapter<T>(action, rootDir), operationParameters);
      } catch (InternalBuildActionFailureException e) {
        throw new BuildActionFailureException(
            "The supplied build action failed with an exception.", e.getCause());
      }
      return result.getModel();
    }
 public <T> T run(
     Class<T> type,
     CancellationToken cancellationToken,
     ConsumerOperationParameters operationParameters)
     throws UnsupportedOperationException, IllegalStateException {
   if (type.equals(Void.class)) {
     doRunBuild(cancellationToken, operationParameters);
     return null;
   } else {
     if (operationParameters.getTasks() != null) {
       throw Exceptions.unsupportedOperationConfiguration(
           "modelBuilder.forTasks()", getVersionDetails().getVersion());
     }
     return doGetModel(type, cancellationToken, operationParameters);
   }
 }