import java.util.Random; public class SingleThreadBank { final Random _r = new Random(); final long INITIAL_FUNDS = 1000000; final int NUM_ACCOUNTS = 4; final long NUM_TRANSFERS = 1000; long[] _accounts = new long[NUM_ACCOUNTS]; void run() { for(int i=0; i "+to+": $"+amount); _accounts[from] -= amount; _accounts[to] += amount; } check(); System.out.println("Done."); } void check() { long sum = 0; for(int i=0; i