public static void main(String[] args) {
		Random gen = new Random();

		// Predefined tests.
		List<List<Boolean>> A = new ArrayList<List<Boolean>>(4);
		// java.util.Arrays.ArrayList<T> used in java.util.Arrays.asList(T...)
		// doesn't support adding a new element, so we'll wrap it with
		// java.util.ArrayList<E> 
		A.add(new ArrayList<Boolean>(Arrays.asList(false, false, false, true)));
		A.add(new ArrayList<Boolean>(Arrays.asList(false, false, false, true)));
		A.add(new ArrayList<Boolean>(Arrays.asList(false, true, true, true)));
		A.add(new ArrayList<Boolean>(Arrays.asList(true, false, false, false)));
		
		boolean[] b = { true, true, false, true };

		boolean[] x = Gaussian_elimination(A, b);

		simplePrint(x);
		System.out.println();

		if (x.length == 0) { // no solution
			assert check_answer_no_solution(A, b);
		} else { // solution
			assert check_answer_with_solution(A, b, x);
		}

		// Perform random tests below
		for (int times = 0; times < 10000; ++times) {
			int n;
			if (args.length == 1) {
				n = Integer.valueOf(args[0]);
				System.out.println("n = " + n);
			} else {
				n = gen.nextInt(16) + 1;
			}

			A = rand_matrix(n, n);

			b = rand_vec(n);

			x = Gaussian_elimination(A, b);
			System.out.println("n = " + n);
			System.out.println("A = ");

			for (List<Boolean> row : A) {
				simplePrint(row);
				System.out.println();
			}
			
			System.out.println("b = ");
			simplePrint(b);
			System.out.println();
			System.out.println();

			if (x.length == 0) { // no solution
				assert check_answer_no_solution(A, b);
			} else { // solution
				System.out.println("x = ");
				simplePrint(x);
				System.out.println();
				System.out.println();
				assert check_answer_with_solution(A, b, x);
			}
		}
	}