public static int[] getJunctionPath(Game game, int nodeIndex, MOVE initialMove) {
		// no move
		if (initialMove == MOVE.NEUTRAL)
			throw new IllegalArgumentException("move must not be NEUTRAL");

		// nodeIndex is a junction
		if (game.isJunction(nodeIndex))
			return new int[] {nodeIndex};

		// impossible move was given
		if (game.getNeighbour(nodeIndex, initialMove) == -1) {
			MOVE[] moves = game.getPossibleMoves(nodeIndex);
			// no turn is possible following the given move
			if (moves[0] != initialMove.opposite() && moves[1] != initialMove.opposite())
				throw new IllegalArgumentException("invalid move given");
			// take turn
			else
				initialMove = game.getPossibleMoves(nodeIndex, initialMove)[0];
		}

		// initialize path traversal
		LinkedList<Integer> pathNodeList = new LinkedList<Integer>();
		pathNodeList.add(nodeIndex);

		MOVE moveDirection = initialMove;
		int currNodeIndex = nodeIndex;

		// follow path until junction is reached
		while (!game.isJunction(currNodeIndex)) {
			// reached a turn
			if (game.getNeighbour(currNodeIndex, moveDirection) == -1)
				moveDirection = game.getPossibleMoves(currNodeIndex, moveDirection)[0];

			currNodeIndex = game.getNeighbour(currNodeIndex, moveDirection);
			pathNodeList.add(currNodeIndex);
		}

		int[] path = new int[pathNodeList.size()];
		for (int i = 0; i < path.length; i++)
			path[i] = pathNodeList.pop();

		return path;
	}