ChangedList implements Serializable { private ChangedList() { fileList = new LinkedHashMap<String, ChangedFile>(); reservedFiles = new LinkedHashMap<String, ChangedFile>(); this.fileExclusionManager = new FileExclusionManager(); listVersion = 0; listeners = new EventListenerSupport<ChangedListListener>(ChangedListListener.class); this.executorService = Executors.newSingleThreadExecutor(); } private  ChangedList(); static synchronized ChangedList getInstance(); void setFileExclusionManager(FileExclusionManager fileExclusionManager); boolean addChangedFile(final File changedFile); int getListSize(); int getListSizeIncludingReservedFiles(); void addListener(ChangedListListener listener); void removeListener(ChangedListListener listener); synchronized void clear(); synchronized ChangedFile reserve(); long getVersion(); long persist(File persistFile); synchronized void restore(File persistFile, List<File> contentDirs); synchronized List<File> peek(int maxFiles); void shutdown();  }
@Test public void testChangedList() throws Exception { long version = changedList.getVersion(); changedList.addChangedFile(changedFile); assertEquals(version + 1, changedList.getVersion()); ChangedFile retrievedFile = changedList.reserve(); assertEquals(changedFile.getAbsolutePath(), retrievedFile.getFile().getAbsolutePath()); assertEquals(version + 2, changedList.getVersion()); }