// Region test: allocate arbitrary size java array class Test1 { public static void main(String[] args) throws RegionInUse { int total = 0; int iters = Integer.parseInt(args[0]); for (int n = iters; n > 0; n--) { PrivateRegion r = new PrivateRegion(); int k = Integer.parseInt(args[1]); int l = Integer.parseInt(args[2]); int[] arr = new(r) int[l]; for (int i = 0; i < l; i++) arr[i] = k; total += sum(arr); r.delete(); } System.out.println(args[0] + " x " + args[1] + " x " + args[2] + " = " + total); } static int sum(int[] a) { int l = a.length; int sum = 0; for (int i = 0; i < l; i++) sum += a[i]; return sum; } }