Dear Annie: What can you do if you work for someone who seems to have fixed ideas about you because of your age? I’m 25, and I’ve been in my first job out of college for a little over two years. I love this company and would really like to stay on into the indefinite future. The problem is my boss. Recently I volunteered to be part of a task force that is working on a long-range project. Even though I have skills that would fit in well with the team, I got turned down.

One of my mentors here told me that my boss wants only people who are likely to be around long enough to see the project to completion and, since I’m a Millennial, he’s assuming I won’t be here two or three years from now. This isn’t the first time I’ve had the impression that he’s pigeonholed me as a “typical Millennial,” but it’s really bugging me now. How do I talk to him about this? — Austin

Dear Austin: Funny, when I read your first sentence above, I immediately thought you must be over 50, and that your boss had automatically pegged you as stuck in the past, resistant to new technology, and generally over the hill. Lots of older employees (and job hunters) resent that stereotype, and rightly so. Dividing people up by when they were born in is a convenient way to make quick decisions about them. The trouble is, when those decisions are based on assumptions rather than on facts, they’re likely to be wrong.

It might help to know you’re not the only Millennial to be “pigeonholed,” as you put it. Jessica Kriegel, a member of the 40-person training and development team at Oracle, wrote a forthcoming book called Unfairly Labeled: How Your Workplace Can Benefit From Ditching Generational Stereotypes. Having been the youngest person in her MBA class, again in her PhD program, and yet again in her first job, Kriegel, now 32, writes that she’s often “struggled with feeling judged” due to “ageist profiling.”

As a result, she adds, “I’ve also felt as though I had to prove myself, which meant that I spent a lot of time early in my career either showing off or being defensive—which created a whole other set of problems.”

Ironically, one of those was that, the more she acted out against being typecast, the more her coworkers perceived her as a “typical Millennial.” She was well aware, for instance, that Gen Y is often stereotyped as lazy. “So I volunteered for a lot of extra assignments, to show I wanted to work hard and contribute,” she says. “People told me that was a sign that I was ‘entitled.’”

Sound familiar? Unfairly Labeled is mainly a guide for managers who want to get better at leading people without getting hung up on when they happened to be born, and it includes an interesting case study of how Kriegel’s team set about changing the culture at Oracle. The book also looks closely at some of the most widespread assumptions about Gen Y, and why they’re so often misleading.

Take, for example, the notion that all Millennials are opportunistic job hoppers (who, your boss believes, won’t stick around long enough to finish a long-term project). On the one hand, the available research does show that employees aged 25 to 24 change jobs, on average, every three years, versus 10-plus years for older workers. However, the same studies also show that in the 1980s, when Gen Xers were in the career stage where Gen Y is now, they changed jobs just as often.

Moreover, an often-cited report from the Bureau of Labor Statistics in 2014 said that Millennials held an average of 6.2 jobs between ages 18 and 26. What got a lot less attention was that, according to the same report, four of those jobs were part-time stints and internships before age 22. Once they had graduated from college, Millennials held an average of two jobs over the following five to six years. That means they actually changed jobs less often than Boomers had done in their twenties.

In other words, Millennials aren’t as different from previous generations as many people think they are. It’s also worth noting that, useful as averages can be, they obviously don’t apply to everyone. People who belong to the same generation may have little else in common. That’s why Kriegel says you need to persuade your boss that you’re a person, not a stereotype. “Sit down with him for a conversation about your career and your goals, including the fact that you love your job and you’d like to stay at the company for a long time,” she suggests. “Talk about what matters to you as a person and an employee, not as a ‘typical’ member of a huge amorphous group.”

At the same time, ask for an honest appraisal of how you’re doing. “The real reason you didn’t get picked for that task force may not be what you think it is,” Kriegel points out. “Or it may be only partly, not entirely, because of your age. You won’t know unless you ask.” Once you’ve requested it, be open to whatever feedback you hear. “You have to be sincere about wanting to know,” she adds. “Don’t be defensive.”

One more tip for anyone, of any age, who feels they’ve been pre-judged based on which generation they belong to: Defy the conventional wisdom. One thing everyone “knows” about Millennials, for instance, is that “they don’t dress appropriately for the workplace,” Kriegel notes. “So make sure you always do.”

Good luck.

Talkback: Have you ever felt stereotyped at work, or in a job search, because of your age? What did you do about it? Leave a comment below.

Have a career question for Anne Fisher? Email askannie@fortune.com.