// suppress unchecked warning @SuppressWarnings( "unchecked" ) void restore() { // Java cannot check that the object is actually an ArrayList<Thing>. // It will just trust that it is. ArrayList<Thing> things = (ArrayList<Thing>) ois.readObject(); ... }