code: public static boolean writeObjectIfChangedOrDie(@Nonnull final Object obj, @Nonnull final String file) throws IOException {
          return writeObjectIfChangedOrDie(obj, file, LOGGER);
      }
docs: Writes an object to a file only if it is different from the current
  contents of the file, or if the file does not exist.  Note that you must
  have enough heap to contain the entire contents of the object graph.
  
  @param obj object to write to a file
  @param file path to save the object to
  @return true if the file was actually written, false if the file was unchanged
  @throws java.io.IOException if the existing file could not be read for comparison,
  if the existing file could not be erased,
  or if the new file could not be written, flushed, synced, or closed