Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 2
    <T extends Collection, Map> declares two type variables: T which is bounded by the raw Collection, and Map which is unbounded. Commented Oct 16, 2018 at 23:48
  • 2
    You can't do it without casting. Sounds like an XY problem. Commented Oct 16, 2018 at 23:50
  • 3
    Write two methods, one for maps and one for collections Commented Oct 16, 2018 at 23:56