static Move getRandomMoveOfFirstMovableTile(Board board, Team team) {
    // Check inputs
    if (board == null) {
      throw new IllegalArgumentException("BoardImpl can't be null");
    }
    if (Team.NEUTRAL.equals(team)) {
      throw new IllegalArgumentException("Invalid team: " + team);
    }

    // Find the first possible move
    for (int fromY = 0; fromY <= board.getMaxIndex(); fromY++) {
      for (int fromX = 0; fromX <= board.getMaxIndex(); fromX++) {
        Collection<Move> moves = board.getPossibleMoves(team, fromX, fromY);
        if (moves != null && !moves.isEmpty()) {
          // Return a random one
          List<Move> list = new ArrayList<Move>(moves);
          Collections.shuffle(list);
          return list.get(0);
        }
      }
    }
    // No moves found
    return null;
  }