private static void test(String input, String output, int v, String dir) {
	int n = input.length();
	boolean[] voters = new boolean[n];	
	int i;
	
	/* convert the string into an array of booleans */
	for (i = 0; i < n; i++) {
	    voters[i] = (input.charAt(i) == 'A');
	}

	Opinion.update(voters, v);

	/* check the output */
	for (i = 0; i < n; i++) {
	    if ((output.charAt(i) == 'A') && (!voters[i])) {
		error(input, output, v, voters, dir);
		break;
	    } else if ((output.charAt(i) == 'B') && (voters[i])) {
		error(input, output, v, voters, dir);
		break;
	    }
	}
	
	if (i == n)
	    System.out.printf("Success: %s @ %d %s => %s\n", input, v, dir, output);

	System.out.println();
    }