@@ -0,0 +1,701 @@
+import java.util.Random;%0D%0A%0D%0Apublic class LockContention %7B%0D%0A    static Random randomGen = new Random();%0D%0A    static int NTHREAD = 100;%0D%0A%0D%0A    static public void main(String args%5B%5D) %7B%0D%0A        Runnable task = () -%3E %7B%0D%0A            for (int i = 0; i %3C 10000000; i++)%0D%0A                randomGen.nextInt(1000);%0D%0A        %7D;%0D%0A%0D%0A        Thread threads%5B%5D = new Thread%5BNTHREAD%5D;%0D%0A        for (int i = 0; i %3C NTHREAD; i++) %7B%0D%0A            threads%5Bi%5D = new Thread(task);%0D%0A            threads%5Bi%5D.start();%0D%0A        %7D%0D%0A        try %7B%0D%0A            for (Thread t : threads)%0D%0A                t.join();%0D%0A        %7D catch (InterruptedException e) %7B%0D%0A            System.err.println(%22Interrupted: %22 + e);%0D%0A        %7D%0D%0A    %7D%0D%0A%7D%0D%0A

Add lock contention example