package test.thread;

import org.testng.annotations.Test;

@Test
public class TrueParallelSampleTest extends BaseThreadTest {
  private void log(String s) {
    logString(s);
    Thread.yield();
    logString(s);
    logCurrentThread();
  }

  public void m1() {
    log("m1");
  }
  
  public void m2() {
    log("m2");
  }

  public void m3() {
    log("m3");
  }

  public void m4() {
    log("m4");
  }

  public void m5() {
    log("m5");
  }
}

@@ -52,16 +52,42 @@
 .Test;%0A%0A
+import java.util.Random;%0A%0A
 @Test%0Apu
@@ -151,55 +151,213 @@
 %7B%0A  
-private void log(String s) %7B%0A    logString(s);%0A
+static Random random = new Random(System.currentTimeMillis());%0A%0A  private void log(String s) %7B%0A    logString(s);%0A    try %7B%0A      Thread.sleep(random.nextInt(10));%0A    %7D catch (InterruptedException ex) %7B%0A  
     
@@ -372,16 +372,22 @@
 ield();%0A
+    %7D%0A
     logS
@@ -465,18 +465,16 @@
 %22);%0A  %7D%0A
-  
 %0A  publi

Increase scheduling randomness