Generate tap file for a class

@param result
181375
protected void generateTapPerClass(Result result) {

        Map<String, List<JUnitTestData>> testsByClass = new HashMap<>();

        for (JUnitTestData testMethod : testMethodsList) {
            String className = TapJUnitUtil.extractClassName(testMethod
                    .getDescription());
            testsByClass.computeIfAbsent(className, k -> new ArrayList<>())
                    .add(testMethod);
        }

        testsByClass.forEach((className, testMethods) -> {
            final TestSet testSet = new TestSet();
            testSet.setPlan(new Plan(testMethods.size()));

            testMethods.forEach(testMethod -> {
                TestResult tapTestResult = TapJUnitUtil.generateTAPTestResult(
                        testMethod, 1, isYaml());
                testSet.addTestResult(tapTestResult);
            });

            File output = new File(System.getProperty("tap.junit.results",
                    "target/"), className + ".tap");
            tapProducer.dump(testSet, output);
        });
    }
807894
public void returnToResultPool(Result result) {
        if (result != null) {
            result.reset();
            resultPool.add(result);
        }
    }
1269531
public void startTearDownFixture(final String containerUuid, final String uuid, final FixtureResult result) {
        storage.getContainer(containerUuid).ifPresent(container -> {
            synchronized (storage) {
                container.getAfters().add(result);
            }
        });

        notifier.beforeFixtureStart(result);
        startFixture(uuid, result);
        notifier.afterFixtureStart(result);
    }
1088854
@Private
  @Override
  public void completed(final int pTaskletId, final TOutput result) {
    assert taskletId == pTaskletId;
    this.userResult = Optional.ofNullable(result);
    if (callbackHandler != null) {
      executor.execute(new Runnable() {
        @Override
        public void run() {
          callbackHandler.onSuccess(userResult.get());
        }
      });
    }
    this.countDownLatch.countDown();
  }
522143
static void setResult(ImageView target, Context context, RequestHandler.Result result,
      boolean noFade, boolean debugging) {
    Drawable placeholder = target.getDrawable();
    if (placeholder instanceof Animatable) {
      ((Animatable) placeholder).stop();
    }

    Bitmap bitmap = result.getBitmap();
    if (bitmap != null) {
      Picasso.LoadedFrom loadedFrom = result.getLoadedFrom();
      PicassoDrawable drawable =
          new PicassoDrawable(context, bitmap, placeholder, loadedFrom, noFade, debugging);
      target.setImageDrawable(drawable);
      return;
    }

    Drawable drawable = result.getDrawable();
    if (drawable != null) {
      target.setImageDrawable(drawable);
      if (drawable instanceof Animatable) {
        ((Animatable) drawable).start();
      }
    }
  }
1087565
@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data);
    }
998334
function TAP13Producer() {
  /**
   * Writes the TAP version to reporter output stream.
   * @override
   */
  this.writeVersion = function() {
    println('TAP version 13');
  };

  /**
   * Writes that test failed to reporter output stream, with error formatting.
   * @override
   */
  this.writeFail = function(n, test, err) {
    TAPProducer.prototype.writeFail.call(this, n, test, err);
    var emitYamlBlock = err.message != null || err.stack != null;
    if (emitYamlBlock) {
      println(indent(1) + '---');
      if (err.message) {
        println(indent(2) + 'message: |-');
        println(err.message.replace(/^/gm, indent(3)));
      }
      if (err.stack) {
        println(indent(2) + 'stack: |-');
        println(err.stack.replace(/^/gm, indent(3)));
      }
      println(indent(1) + '...');
    }
  };

  function indent(level) {
    return Array(level + 1).join('  ');
  }
}
1245563
public static <R> MethodResult<R> success(R result) {
        return new MethodResult<>(result, null, false);
    }
397470
public static <T> CompletableFuture<T> completedFuture(T result) {
    CompletableFuture<T> future = new AtomixFuture<>();
    future.complete(result);
    return future;
  }
499576
public void transform(Result result) {
    if (logger.isInfoEnabled())
      logger.info("Transforming source into result");
    try {
      if (content == null) {
        throw new IllegalStateException("No source to transform");
      }

      Transformer transformer = null;
      if (this.transformer != null) {
        transformer = getTransformer();
      } else {
        if (logger.isWarnEnabled())
          logger.warn("No transformer, so using identity transform");
        transformer = TransformerFactory.newInstance().newTransformer();
      }

      transformer.transform(content, result);
    } catch (TransformerException e) {
      logger.error("Failed to transform source into result",e);
      throw new MarkLogicIOException(e);
    }
  }
1253923
protected boolean setResult(Object result) {
        for (; ; ) {
            Object currentState = this.state;

            if (isDoneState(currentState)) {
                return false;
            }

            if (STATE.compareAndSet(this, currentState, result)) {
                done();
                notifyThreadsWaitingOnGet();
                runAsynchronous((ExecutionCallbackNode) currentState, result);
                break;
            }
        }
        return true;
    }
955342
public Future<V> submit(Runnable task, V result) {
        if (task == null) throw new NullPointerException();
        NotifyingFuture<V> f = executor.submit(task, result);
        f.setListener(listener);
        return f;
    }
421862
public void setResult(R result) {
        try {
            lock.lock();
            this.result = result;
            notifyHaveResult();
        }
        finally {
            lock.unlock();
        }
    }
1218174
@Override
    protected void putDumpInfoTo(Map<String, Object> result) {
        if(StringUtils.isNotBlank(this.url)) {
            result.put(DumpConstants.URL, this.url);
        }
    }
1148631
private void addResult(ValidationResult result) {
		if (result == null || result.count() == 0) {
			return;
		}
		this.results.add(result);
	}
1316527
protected void transformTo(final Result result) throws TransformerException {
        withExceptionHandling(new Trans<Object>() {
                public Object transform() {
                    transformation.transformTo(result);
                    return null;
                }
            });
    }
274622
public void addSearchResult(CaptureSearchResult result, boolean append) {
		String resultDate = result.getCaptureTimestamp();
		if ((firstResultTimestamp == null) ||
				(firstResultTimestamp.compareTo(resultDate) > 0)) {
			firstResultTimestamp = resultDate;
		}
		if ((lastResultTimestamp == null) ||
				(lastResultTimestamp.compareTo(resultDate) < 0)) {
			lastResultTimestamp = resultDate;
		}

		if (append) {

			if (!results.isEmpty()) {
				results.getLast().setNextResult(result);
				result.setPrevResult(results.getLast());
			}

			results.add(result);
		} else {
			if (!results.isEmpty()) {
				results.getFirst().setPrevResult(result);
				result.setNextResult(results.getFirst());
			}

			results.add(0, result);
		}
	}