[Demonstration 1]

[Buggy Method]
public InputStream getInputStream() {
    if (in == null) {
        long readTimeout = JOVALSystem.getLongProperty(JOVALSystem.PROP_SUDO_READ_TIMEOUT);
        in = (PerishableReader) PerishableReader.newInstance(p.getInputStream(), readTimeout);
        in.setLogger(us.getLogger());
    }
    return in;
}

[Buggy Hunk]
public InputStream getInputStream() {

[Patch]
public InputStream getInputStream() throws IOException {

[Demonstration 2]

[Buggy Method]
public String sendRequest() throws IOException, MalformedURLException, ProtocolException {
    HttpURLConnection urlConnection = null;
    BufferedReader reader = null;
    try {
        URL url = new URL(buildUri.toString());
        urlConnection = (HttpURLConnection) url.openConnection();
        urlConnection.setRequestMethod(HTTPMethod);
        urlConnection.connect();
        InputStream inputStream = urlConnection.getInputStream();
        StringBuffer buffer = new StringBuffer();
        if (inputStream == null) {
            return null;
        }
        reader = new BufferedReader(new InputStreamReader(inputStream));
        String line;
        while ((line = reader.readLine()) != null) {
            buffer.append(line + "\n");
        }
        if (buffer.length() == 0) {
            return null;
        }
        return buffer.toString();
    } catch (MalformedURLException e) {
        e.printStackTrace();
        return null;
    } catch (ProtocolException e) {
        e.printStackTrace();
        return null;
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    } finally {
        if (urlConnection != null) {
            urlConnection.disconnect();
        }
        if (reader != null) {
            try {
                reader.close();
            } catch (final IOException e) {
                Log.e(getClass().getSimpleName(), "Error closing stream", e);
            }
        }
    }
}

[Buggy Hunk]
public String sendRequest() throws IOException, MalformedURLException, ProtocolException {

[Patch]
public String sendRequest() {

[Demonstration 3]

[Buggy Method]
private Money getGrossPromoReduction(final BillItem item) {
    return item.getExtraAndVariationOffers().stream().filter(o -> (o instanceof PromoOffer)).map(o -> o.getPriceGross().absolute()).reduce((p1, p2) -> p1.add(p2)).get();
}

[Buggy Hunk]
.reduce((p1, p2) -> p1.add(p2)).get();

[Patch]
.reduce((p1, p2) -> p1.add(p2)).orElse(ZERO);