public static void main(String[] args) {

        ArrayList<Atom> atoms = new ArrayList<Atom>();
        atoms.add(new Broken());
        atoms.add(new Unsafe());
        atoms.add(new Safe());
        atoms.add(new Locked());

        for (Atom atom : atoms) {

            long s = System.currentTimeMillis();
            ArrayList<Thread> threads = new ArrayList<Thread>();
            for (int i = 0; i < THREDS; ++i) {
                threads.add(new Thread(atom));
            }

            for (Thread thread : threads) {
                thread.start();
            }

            for (Thread thread : threads) {
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    throw new RuntimeException();
                }
            }

            for (Thread thread : threads) {
                if (thread.getState() != Thread.State.TERMINATED) {
                    throw new RuntimeException();
                }
            }
            System.out.print(atom.toString() + ": " + (System.currentTimeMillis() - s)
                    + " ms; ");

            if (atom.getCount() != EXPECTED_RESULT) {
                System.out.println("Result " + atom.getCount() + " but expected "
                        + EXPECTED_RESULT);
            } else {
                System.out.println("done");
            }
        }
    }