I have a problem with bounded nested wildcards in Java generics.
Here\'s a common case:
public void doSomething(Set extends Number> set) {}
So the problem is, doSomething could be implemented as:
public void doSomething(Map<String, Set<? extends Number>> map) {
Set<Float> set = ...;
map.put("xyz", set);
}
You need to decide what you actually mean.
Probably something like:
public void doSomething(Map<String, ? extends Set<? extends Number>> map) {}
this will work for you:
public void doSomething(Map<String, ? extends Set<? extends Number>> map) {}
To make code to work Create HashMap as:
Map<String, Set<? extents Number>> map = new HashMap<String, Set<? extents Number>>();