private Stream<DynamicTest> createDynamicTestStream() {

            AtomicInteger caseCounter = new AtomicInteger();

            return testCases.stream()
                    .sequential()
                    .map(testCase -> {

                        // Name defined in the testCase overrides the name function
                        final String testName = buildTestName(
                                testCase,
                                caseCounter.incrementAndGet(),
                                testCases.size());

                        return DynamicTest.dynamicTest(testName, () -> {
                            NullSafe.consume(beforeCaseAction, action ->
                                    runAction(action, "Before Test Case"));

                            if (LOGGER.isDebugEnabled()) {
                                logCaseToDebug(testCase);
                            }
                            O actualOutput = null;
                            Throwable actualThrowable = null;
                            try {
                                actualOutput = testAction.apply(testCase);
                            } catch (Throwable t) {
                                actualThrowable = t;
                                if (!testCase.isExpectedToThrow()) {
                                    Assertions.fail(LogUtil.message(
                                            "Not expecting test to throw an exception but it threw {} '{}'",
                                            t, t.getMessage()), t);
                                }
                            }
                            if (actualOutputConsumer != null) {
                                actualOutputConsumer.accept(LogUtil.message("Actual output: '{}'", actualOutput));
                            }
                            if (logActualOutput) {
                                LOGGER.debug("Actual output: '{}'", actualOutput);
                            }

                            final TestOutcome<I, O> testOutcome = new TestOutcome<>(
                                    testCase, actualOutput, actualThrowable);

                            testOutcomeConsumer.accept(testOutcome);

                            NullSafe.consume(afterCaseAction, action ->
                                    runAction(action, "After Test Case"));
                        });
                    });
        }
Build the {@link Stream} of {@link DynamicTest} with all the added test cases.
stroom-test-common/src/main/java/stroom/test/common/DynamicTestBuilder.java