[Demonstration 1]

[Buggy Method]
private boolean get(String link, File out, String checksum, int tries) {
    System.out.println("Downloading: " + link + " to: " + out.getAbsolutePath());
    DigestInputStream input = null;
    FileOutputStream output = null;
    int n;
    try {
        MessageDigest md = MessageDigest.getInstance("MD5");
        URL url = new URL(link);
        URLConnection con = url.openConnection();
        byte[] buffer = new byte[4096];
        input = new DigestInputStream(con.getInputStream(), md);
        output = new FileOutputStream(out);
        while ((n = input.read(buffer)) != -1) {
            output.write(buffer, 0, n);
        }
        output.flush();
        String sum = getToHex(md.digest());
        if (sum.equals(checksum)) {
            //OK
            return true;
        }
    } catch (MalformedInputException ex) {
        LOG.error(ex.getMessage(), ex);
    } catch (IOException ex) {
        LOG.error(ex.getMessage(), ex);
    } catch (NoSuchAlgorithmException ex) {
        LOG.error(ex.getMessage(), ex);
    } finally {
        if (input != null) {
            try {
                input.close();
            } catch (IOException ex) {
                LOG.error(ex.getMessage(), ex);
            }
        }
        if (output != null) {
            try {
                output.close();
            } catch (IOException ex) {
                LOG.error(ex.getMessage(), ex);
            }
        }
    }
    if (tries < 10) {
        //Retry 10 times
        out.delete();
        tries++;
        return get(link, out, checksum, tries);
    } else {
        //Failed 10 times, I give up...
        return false;
    }
}

[Buggy Hunk]
System.out.println("Downloading: " + link + " to: " + out.getAbsolutePath());

[Patch]
LOG.info("Downloading: " + link + " to: " + out.getAbsolutePath());

[Demonstration 2]

[Buggy Method]
@Test
public void testFindTempLessThan() {
    double[] temperatureSeries = { 1.0, -5.0, 1.0, 5.0, -20.5, 13.5, 2.0, 0.0, 0.5, 11.3, 10.0, -10.0, 15.0, 16.0, -17.0, 29.0, -88.0, -19.0, 13.5, 14.1, -11.0, -15.0, 29.0, -23.4, -2.7 };
    TemperatureSeriesAnalysis seriesAnalysis = new TemperatureSeriesAnalysis(temperatureSeries);
    double[] expResult = { 1.0, -5.0, 1.0, 5.0, -20.5, 13.5, 2.0, 0.0, 0.5, 11.3, 10.0, -10.0, -17.0, -88.0, -19.0, 13.5, 14.1, -11.0, -15.0, -23.4, -2.7 };
    double[] actualResult = seriesAnalysis.findTempsLessThen(14.3);
    assertEquals(expResult.length, actualResult.length);
    for (int i = 0; i < expResult.length; ++i) {
        assertEquals(expResult[i], actualResult[i], 0.00001);
    }
}

[Buggy Hunk]
double[] actualResult = seriesAnalysis.findTempsLessThen(14.3);

[Patch]
double[] actualResult = seriesAnalysis.findTempsLessThan(14.3);

[Demonstration 3]

[Buggy Method]
public void close() {
    logger.info("close called ...");
}

[Buggy Hunk]
logger.info("close called ...");

[Patch]
logger.debug("close called ...");