Your team has built a generic repository used by several Spring Boot services for caching reference data before it’s persisted.
A teammate recently tried to reuse it for a new feature and hit a compilation error.
You’re reviewing their pull request.
The new feature does this:
📢 Get actionable Java and Spring Boot insights every week, including practical code tips and real-world, use-case-based interview questions, to help you level up your backend skills—join 8300+ subscribers for hand-crafted, no-fluff content.
Upgrade to paid now (60% discount) and get the annual membership at $50/year forever that is ~ $4/mo.
Testimonials
A common misconception is:
"AdminUser extends User, so List<AdminUser> should extend List<User>."
That's not how Java generics work. Generics are invariant.

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.