[Demonstration 1]

[Buggy Method]
@Test
public void test() throws Throwable {
    final File expDir = new File(testDir, EXP_DIR);
    System.err.println("Testcase: " + testDir.getName());
    List<TestListener.Message> log = null;
    try {
        log = run(testDir, expDir.list());
        compare(expDir, new File(resultDir, testDir.getName()));
    } catch (final Throwable e) {
        if (level >= 0) {
            System.err.println("Log start: " + testDir.getName());
            for (final TestListener.Message m : log) {
                if (m.level <= level) {
                    switch(m.level) {
                        case -1:
                            break;
                        case Project.MSG_ERR:
                            System.err.print("ERROR: ");
                            break;
                        case Project.MSG_WARN:
                            System.err.print("WARN:  ");
                            break;
                        case Project.MSG_INFO:
                            System.err.print("INFO:  ");
                            break;
                        case Project.MSG_VERBOSE:
                            System.err.print("VERBO: ");
                            break;
                        case Project.MSG_DEBUG:
                            System.err.print("DEBUG: ");
                            break;
                    }
                    System.err.println(m.message);
                }
            }
            System.err.println("Log start: " + testDir.getName());
        }
        throw new Throwable("Case " + testDir.getName() + " failed: " + e.getMessage(), e);
    }
}

[Buggy Hunk]
if (level >= 0) {

[Patch]
if (log != null && level >= 0) {

[Demonstration 2]

[Buggy Method]
@Activate
public void activate(final Map<String, ?> properties) {
    config = Configurable.createConfigurable(Config.class, properties);
    super.activate(config.agentId());
    MarketBasis marketBasis = new MarketBasis(config.commodity(), config.currency(), config.priceSteps(), config.minimumPrice(), config.maximumPrice());
    configure(marketBasis, config.clusterId());
}

[Buggy Hunk]
configure(marketBasis, config.clusterId());

[Patch]
configure(marketBasis, config.clusterId(), config.minTimeBetweenPriceUpdates());

[Demonstration 3]

[Buggy Method]
@Override
public Long cancelProcess(Long projectId, Long id, String authToken) throws Exception {
    Logger.getLogger(getClass()).debug("Process Client - cancel process execution " + id);
    Client client = ClientBuilder.newClient();
    WebTarget target = client.target(config.getProperty("base.url") + "/process/execution/" + id + "/cancel" + "?projectId=" + projectId);
    Response response = target.request(MediaType.APPLICATION_XML).header("Authorization", authToken).get();
    final String resultString = response.readEntity(String.class);
    if (response.getStatusInfo().getFamily() == Family.SUCCESSFUL) {
        // n/a
    } else {
        throw new Exception(response.toString());
    }
    // converting to object
    return Long.parseLong(resultString);
}

[Buggy Hunk]
Response response = target.request(MediaType.APPLICATION_XML)

[Patch]
Response response = target.request(MediaType.TEXT_PLAIN)