I'm pretty sure there is a generics safety issue with the compiler by me trying to cast the Object to an ArrayList.
Not just a Generics safety issue, a type safety issue. You are assuming that the next thing is an ArrayList
and that you can safely use it as an ArrayList<Integer>.
How can I save the ArrayList without causing this?
Your problem isn't with saving it, it is with getting it back. Add @SuppressWarnings("unchecked")
or whatever it is before the declaration.