### Question:
InterfaceSaver { public byte[] save(InterfaceDefinition def) { if (def.hasScript) { return saveScript(def); } else { return saveNoScript(def); } }  byte[] save(InterfaceDefinition def);  }### Answer:
@Test public void testSave() throws Exception { File base = StoreLocation.LOCATION; try (Store store = new Store(base)) { store.load(); Storage storage = store.getStorage(); Index index = store.getIndex(IndexType.INTERFACES); Archive archive = index.getArchive(149); byte[] archiveData = storage.loadArchive(archive); ArchiveFiles files = archive.getFiles(archiveData); FSFile file = files.findFile(0); byte[] contents = file.getContents(); InterfaceDefinition def = new InterfaceLoader().load(0, contents); byte[] b = new InterfaceSaver().save(def); assertArrayEquals(contents, b); } }