This is probably just a question of syntax (and my inability to find it ;)
Here's the collections to be (de)serialized:
private Map<String, Terminal> terminals = Collections.synchronizedMap(new HashMap<String, Terminal>());
private List<Host> hosts = Collections.synchronizedList(new ArrayList<Host>());
Here goes serialization:
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("blah.dmp"));
out.writeObject(synchronizedMap);
out.writeObject(synchronizedList);
and now de-serializing, this throws a ClassCastException (obviously):
terminals = (HashMap<String, Terminal>) in.readObject();
hosts = (ArrayList<Hosts>) in.readObject();
but the following won't compile (as well as manyyyyy other variations i've tried):
terminals = (Collections.synchronizedMap(new HashMap<String, Terminal>())) in.readObject();
hosts = (Collections.synchronizedList(new ArrayList<Host>())) in.readObject();