List<Action> actions = new ArrayList<Action>(EightPuzzleFunctionFactory
.getActionsFunction().actions(board));
Assert.assertEquals(3, actions.size());
// test first successor
EightPuzzleBoard expectedFirst = new EightPuzzleBoard(new int[] { 1, 2,
0, 3, 4, 5, 6, 7, 8 });
EightPuzzleBoard actualFirst = (EightPuzzleBoard) EightPuzzleFunctionFactory
.getResultFunction().result(board, actions.get(0));
Assert.assertEquals(expectedFirst, actualFirst);
Assert.assertEquals(EightPuzzleBoard.UP, actions.get(0));
// test second successor
EightPuzzleBoard expectedSecond = new EightPuzzleBoard(new int[] { 1,
2, 5, 3, 4, 8, 6, 7, 0 });
EightPuzzleBoard actualSecond = (EightPuzzleBoard) EightPuzzleFunctionFactory
.getResultFunction().result(board, actions.get(1));
Assert.assertEquals(expectedSecond, actualSecond);
Assert.assertEquals(EightPuzzleBoard.DOWN, actions.get(1));
// test third successor
EightPuzzleBoard expectedThird = new EightPuzzleBoard(new int[] { 1, 2,
5, 3, 0, 4, 6, 7, 8 });
EightPuzzleBoard actualThird = (EightPuzzleBoard) (EightPuzzleBoard) EightPuzzleFunctionFactory
.getResultFunction().result(board, actions.get(2));
Assert.assertEquals(expectedThird, actualThird);
Assert.assertEquals(EightPuzzleBoard.LEFT, actions.get(2));
}