title: Create two dynamic test in each loop
body: <p>I'm trying to create dynamic tests, where each loop is creating two separate tests.
  Right now I have the below code, which is creating exactly 7 tests as appears in the ArrayList. Since the name of the test is defined in <code>.map((testName-&gt;</code> part, only one test is created each loop. Is there a way to separate those two (the first and second assert)? I'm struggling a bit with this type of syntax since I'm new to Java and can't figure it out.</p>
  <pre><code>@TestFactory
      Stream&lt;DynamicTest&gt; AllPythonTests() throws IOException, InterruptedException {
          ArrayList&lt;String&gt; inputStream = new ArrayList&lt;String&gt;(
                  Arrays.asList(&quot;test_parsing&quot;, &quot;test_get_all_targets&quot;,&quot;test_handle_port&quot;, &quot;test_handle_prefix&quot;,
                          &quot;test_read_conf&quot;, &quot;test_choose_all_targets_from_conf&quot;, &quot;test_get_output&quot;));
          return inputStream.stream().map((testName) -&gt; {
              return DynamicTest.dynamicTest(&quot;testing: &quot; + testName, () -&gt; {
                  String testOutput = getOutput(testName,&quot;&quot;);
                  org.hamcrest.MatcherAssert.assertThat(testOutput, containsString(&quot;OK&quot;));
                  String testOutputAsync = getOutput(testName + &quot;_async&quot;,&quot;_async&quot;);
                  org.hamcrest.MatcherAssert.assertThat(testOutputAsync, containsString(&quot;OK&quot;));
  
              });
  </code></pre>