@@ -0,0 +1,1005 @@
+package java7.atomic;%0A%0Aimport java.util.concurrent.atomic.AtomicInteger;%0A%0Apublic class AtomicIntegerTest %7B%0A    %0A    private static AtomicInteger x = new AtomicInteger(0);%0A    private static AtomicInteger y = new AtomicInteger(0);%0A    %0A    private static class Runner extends Thread %7B%0A        %0A        @Override%0A        public void run() %7B%0A            for (int i = 0; i %3C 100; i++) %7B%0A                sleepMS(10);%0A                x.getAndIncrement();%0A            %7D%0A            System.out.println(y.incrementAndGet());%0A        %7D%0A        %0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        for (int i = 0; i %3C 100; i++) %7B%0A            new Runner().start();%0A        %7D%0A        while (y.get() != 100) %7B%0A            sleepMS(100);%0A        %7D%0A        System.out.println(%22y=%22 + y.get());%0A    %7D%0A    %0A    private static void sleepMS(long millis) %7B%0A        try %7B%0A            Thread.sleep(millis);%0A        %7D catch (InterruptedException ex) %7B%0A            ex.printStackTrace(System.err);%0A        %7D%0A    %7D%0A    %0A%7D%0A

add AtomicIntegerTest