public static void test(PersistedQueueManager queueManager) throws Exception {
        processed.set(0);

        // create an ArmyAudit that just show to standard output
        ArmyAudit armyAudit = new SystemOutAudit();
        //ArmyAudit armyAudit = new NegligentAuditor();

        // create an Army to make machine guns
        final Army army = new Army(armyAudit, queueManager);

        // here is the dirty task producer
        // ProcessIntegerSlowly simulates a "dirty work" and just sleep randomly
        Factory<DirtyWork<Integer>> dirtyWorkFactory = new Factory<DirtyWork<Integer>>() {
            @Override
            public DirtyWork<Integer> buildANewInstance() throws BuildingException {
                return new DirtyWork<Integer>() {
                    @Override
                    public void workOnIt(long jobId, String consumerName, ArmyAudit audit, Integer dataToBeProcessed) {
                        Integer time = random.nextInt(2);

                        System.out.println("*** Will process " + dataToBeProcessed
                                + " for " + time + " millis...");

                        try {
                            Thread.sleep(time);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }

                        decrease(dataToBeProcessed);

                        audit.aConsumerHasBeenFinishedHisJob(jobId, consumerName, true, null, "OK!");
                    }
                };
            }
        };

        // This capsule uses the Java default serialization implementation
        Capsule<Integer> capsule = new GenericCapsuleForLazyPeople<Integer>();

        // start the mission called "default mission" working on "default queue"
        army.startANewMission("default mission", "default queue",
                dirtyWorkFactory, capsule, 100000, 4, 12);

        Thread[] threads = new Thread[THREADS];

        // get a machine gun to strafe
        final MachineGun<Integer> machineGun
                = army.getANewMachineGun("default mission");        

        for (int i = 0; i < threads.length; i++) {
            final int y = i;

            threads[i] = new Thread("Producer " + i + " of " + threads.length) {
                public void run() {
                    for (int j = 0; j < TESTS; j++) {
                        if (j % 100000 == 0) {
                            System.out.print("" + y);
                        }

                        try {
                            final int n = sequential.incrementAndGet();
                            System.out.println(Thread
                                    .currentThread().getName()
                                    + " will produce " + n);

                            increase(n);

                            // strafe
                            machineGun.fire(n);
                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }
                    }
                }
            };

            // start the producer
            threads[i].start();
        }

        // wait the producers die
        for (Thread thread : threads) {
            thread.join();
        }

        // wait the queue is empty
        while (!queueManager.isEmpty("default queue")) {
            System.out.print("?");
            Thread.sleep(1000);
        }

        // make all consumers die
        army.stopTheMission("default mission");

        // everything was well processed?
        if (processed.get() != 0) {
            System.err.println("ERROR size != 0: " + processed);
        }

        assert processed.get() == 0;
    }