title: Write contents of static Object to disk at the end of the program
body: <p>Is there a reliable way to write the contents of a static object to disk when the program ends?</p>
  
  <p>At the moment, I call a <code>persist()</code> method on the static object at the end of each main() method that uses the static object. I wonder whether this can be done automatically.</p>