private void printCataloguedSteps(String format, List<CataloguedStep> snapshot, Consumer<String> messageWriter, Function<CataloguedStep, Number> extractTimeFunction) { snapshot.forEach(stepInvoker -> { messageWriter.accept(format(format, stepInvoker.getCategory(), stepInvoker.getPattern(), stepInvoker.getInvocationCount(), stepInvoker.getFailCount(), extractTimeFunction.apply(stepInvoker))); }); } }
private CataloguedStep mergeCatalogueSteps(CataloguedStep s1, CataloguedStep s2) { return new CataloguedStep( s1.getCategory(), s1.isDeprecated(), s1.getPattern(), s1.getInvocationCount() + s2.getInvocationCount(), s1.getCumulativeTime() + s2.getCumulativeTime(), max(s1.getMaxTime(), s2.getMaxTime()), s1.getPassCount() + s2.getPassCount(), s1.getFailCount() + s2.getFailCount() ); }