This is because the compiler can not verify the internal types at the list level, so you need to first verify for list. And the internal types individually.
Instead of ArrayList list = (ArrayList) obj[1];
It should be
ArrayList> list = (ArrayList>) obj[1];