How do I correctly instantiate a HashMap whose values are variants of List<Number> - i.e., the values could take the form of List<Long> and/or List<Double>. Here's what I've tried so far:
HashMap<String, List<Number>> foo = new HashMap<String, List<Number>>();
foo.put("Tenticles", new ArrayList<Long>());
The error message: The method put(String, List<Number>) ... is not applicable for the arguments (String, List<Long>).
I also want to be able to add a Long to a constituent List<Long> and likewise with any Double.
EDIT These answers don't show how to add a Long or a Double to one of the constituent lists.
foo.put("Tenticles", new ArrayList<Number>()), though.