### Question:
PersistentObject implements Serializable { public void saveToFile(String filename) throws IOException { File file = PersistentObject.buildFile(ResourceUtils.normalizeResourceName(filename)); file.getParentFile().mkdirs(); FileOutputStream output = new FileOutputStream(file); this.toJSON(output); output.flush(); output.close(); } PersistentObject();  PersistentObject(String name); final String getResourceClassName(); final void setResourceClassName(String resourceClassName); String getResourceName(); @Override String toString(); final synchronized void setResourceName(String resourceName); final Map<String, Object> getProperties(); final void setProperties(Map<String, Object> properties); @Override int hashCode(); @Override boolean equals(Object o); static File buildFile(String filename); String toJSON(OutputStream output); void saveToFile(String filename); void save(String user,String collection); static void save(List<ResourceAnchor> resourceAnchors); String saveToJSON(); static void delete(List<ResourceAnchor> resourceAnchors); void delete(String user,String collection); static void delete(String owner, String containerName, String resourceName); static final PersistentObject newObjectFromJSON(String json); static final List<PersistentObject> find(String user,
                                                     String name,
                                                     Map<String,Object> query); static final List<PersistentObject> find(String user,
                                                     String name,
                                                     Map<String,Object> query,
                                                     Class objectClass); static final PersistentObject newObjectFromFile(String fileName); static final PersistentObject newObjectFromFile(String fileName, Class c);  }### Answer:
@Test public void testSaveToFile() throws Exception { }