/** * Makes copies of the original value all the objects that we wish to track. * * <p>Shallow copies are sufficient since none of our objects contain children. (All lists are * stored as comma-delimited strings so they can be serialized nicely.) * * @param originalObjects */ public void initialise(Collection<?> originalObjects) { this.originalObjects = new HashMap<String, TohuObject>(); for (Object object : originalObjects) { if (object instanceof TohuObject) { TohuObject i = (TohuObject) object; try { this.originalObjects.put(i.getId(), (TohuObject) i.clone()); } catch (CloneNotSupportedException e) { // ignore } } else if (object instanceof Answer) { Answer answer = (Answer) object; storeClientAnswer(answer); } } }