public void run() {
                ThreadLocalRandom random = ThreadLocalRandom.current();
                try {
                    latch.await();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                bank.transfer(accounts[random.nextInt(0, ACCOUNTS_COUNT)],
                        accounts[random.nextInt(0, ACCOUNTS_COUNT)],
                        random.nextDouble(0, 320.d));
            }
        }

        Thread[] threads = new Thread[THREADS_COUNT];
        for (Thread thread : threads) {
            thread = new Worker();
            thread.start();
        }

        latch.countDown();

        for (Thread thread : threads) {
            if (thread != null && thread.isAlive()) thread.join();
        }