DeleteChecker implements Runnable { protected DeleteChecker(SyncEndpoint syncEndpoint, String spaceId, List<File> syncDirs, String prefix) { this.syncEndpoint = syncEndpoint; this.spaceId = spaceId; this.syncDirs = syncDirs; this.prefix = prefix; this.filesList = syncEndpoint.getFilesList(); } protected  DeleteChecker(SyncEndpoint syncEndpoint,
                            String spaceId,
                            List<File> syncDirs,
                            String prefix); void run(); boolean checkComplete(); void stop(); static DeleteChecker start(SyncEndpoint syncEndpoint,
                                      String spaceId,
                                      List<File> syncDirs,
                                      String prefix);  }
@Test public void testDeleteChecker() throws Exception { File tempFile = File.createTempFile("temp", "file", tempDir); String delFile = "deletedFile"; List<String> filesList = new ArrayList<>(); filesList.add(tempFile.getName()); filesList.add(delFile); List<File> syncDirs = new ArrayList<>(); syncDirs.add(tempDir); EasyMock.expect(syncEndpoint.getFilesList()) .andReturn(filesList.iterator()); syncEndpoint.deleteContent(spaceId, delFile); EasyMock.expectLastCall().once(); replayMocks(); DeleteChecker deleteChecker = new DeleteChecker(syncEndpoint, spaceId, syncDirs, null); deleteChecker.run(); }