[Demonstration 1]

[Buggy Method]
protected void useDelay() throws InterruptedException {
    // delay 5 sec
    Thread.sleep(2000);
}

[Buggy Hunk]
protected void useDelay() throws InterruptedException {

[Patch]
public void useDelay() throws InterruptedException {

[Demonstration 2]

[Buggy Method]
@Override
public void downloadFile(VirtualFile file, final HttpDownloadProcessor processor, final String proto) throws AccessDeniedException, IOException {
    if (file.getMount() == null) {
        throw new IOException("Download must be a file and have a valid mount point!");
    }
    FileResolver<Object> resolver = new FileResolver<Object>(true, false) {

        void checkFile(FileObject file) throws IOException {
            if (file.getType() != FileType.FILE) {
                throw new IOException("Download must be a file!");
            }
        }

        @Override
        Object onFileResolved(FileResource resource, String childPath, FileObject file, String virtualPath) throws IOException {
            processor.startDownload(resource, childPath, file, VirtualFileServiceImpl.this);
            return null;
        }

        @Override
        void onFileUnresolved(String path, Exception t) {
            eventService.publishEvent(new DownloadStartedEvent(this, t, getCurrentSession(), path, proto));
        }
    };
    resolver.processRequest(file);
}

[Buggy Hunk]
throw new IOException("Download must be a file!");

[Patch]
throw new FileNotFoundException("Download must be a file!");

[Demonstration 3]

[Buggy Method]
@Test
public void executeAddSuccessful() throws Exception {
    // setup expectations
    TestDataHelper helper = new TestDataHelper();
    Task toBeAdded = helper.event();
    Model expectedModel = new ModelManager();
    expectedModel.addTask(toBeAdded);
    String expectedMessage = String.format(AddCommand.MESSAGE_SUCCESS, toBeAdded);
    // execute command and verify result
    try {
        CommandResult result = logic.execute(helper.generateAddCommand(toBeAdded));
        assertEquals(expectedMessage, result.feedbackToUser);
    } catch (CommandException | ParseException e) {
        assertEquals(expectedMessage, e.getMessage());
    }
    assertEquals(expectedModel, model);
    assertEquals(expectedModel.getTaskBook(), latestSavedTaskBook);
}

[Buggy Hunk]
assertEquals(expectedModel.getTaskBook(), latestSavedTaskBook);

[Patch]
assertEquals(expectedModel.getTaskList(), latestSavedTaskList);