@Test
	public void testIsDeadLock() throws IOException {
		FileInputStream fis = new FileInputStream("deadlock-cases.txt");
		DataInputStream in = new DataInputStream(fis);
		BufferedReader br = new BufferedReader(new InputStreamReader(in));

		String line;
		boolean shouldDeadlock;
		Vector<String> lines = new Vector<String>();
		int correctIdentified = 0;
		int total = 0;
		while ((line = br.readLine()) != null) {
			lines.clear();
			if (line.startsWith("DEADLOCK")) {
				shouldDeadlock = true;
			} else if (line.startsWith("NOT DEADLOCK")) {
				shouldDeadlock = false;
			} else {
				continue;
			}

			while ((line = br.readLine()) != null) {
				if (line.length() < 2) {
					break;
				}

				lines.add(line);
			}

			total++;

			Board board = new Board(lines);
//			System.out.println((shouldDeadlock ? "DEADLOCK" : "NOT DEADLOCK"));
//			board.startState().printState();

			boolean result = false;
			for (BoardCoordinate bc : board.startState().boxCoordinates) {
				if (board.deadAt(bc.row, bc.column)) {
					result = true;
					break;
				}
			}
			
			if (!result) result = DeadlockFinder.isDeadLock(board.startState());
			
//			if (result) {
//				System.out.print("identified as deadlock");
//			} else {
//				System.out.print("identified as not deadlock");
//			}
//			
//			System.out.println("\n\n\n");

			if (result == shouldDeadlock) {
				correctIdentified++;
			}
		}

//		System.out.println("Identified " + correctIdentified + " of " + total + " deadlocks");
		assertEquals(correctIdentified, total);

		in.close();
	}