I've stored an ArrayList in a Map and I'm trying to get this ArrayList back:
//init map with data: Map<Integer, ArrayList<MyObject>>
while(iterator.hasNext()) {
Entry entry = iterator.next();
ArrayList value = (ArrayList)entry.getValue();
}
The cast of the entry.getValue() to a general ArrayList seems to work, however when I try to cast it to the specific ArrayList:
ArrayList<MyObject> value = (ArrayList<MyObject>)entry.getValue();
the compiler throughs an error. Some sort of "Warning from last compilation". Is it possible to cast it to my specific ArrayList so that I can loop through it with a For-Each-Loop afterwards?