[Demonstration 1]

[Buggy Method]
private Set<SqrlOptionFlag> parseOptionFlags(final Map<String, String> clientParameters) {
    String optionString = clientParameters.get(OPTIONS);
    return (optionString == null) ? null : Stream.of(optionString.split("~")).map(SqrlOptionFlag::from).filter(o -> o != null).collect(Collectors.toSet());
}

[Buggy Hunk]
return (optionString == null) ? null :

[Patch]
return (optionString == null || "".equals(optionString)) ? new HashSet<>() :

[Demonstration 2]

[Buggy Method]
private void obeyOrder(Order order) {
    VerbMeaning orderMeaning = order.getVerb().getMeaning();
    if (orderMeaning instanceof Stop) {
        if (order.getObject() == null) {
            this.stopPrgm = true;
        } else {
            try {
                executeCommand("killall " + order.getObject());
                say(order.getObject() + " stopped");
            } catch (IOException e) {
                say("I don't know how to do that");
            } catch (NoSuchElementException e) {
                say("There is no such program to stop");
            }
        }
    } else if (orderMeaning instanceof StartSoftware) {
        startSoftware(order.getObject());
    } else if (orderMeaning instanceof Explain) {
        try {
            say(executeCommand("./showDef " + translator.getLanguageParameterForGetDefProgram() + " " + order.getObject()));
        } catch (IOException e) {
            say("I don't know how to explain that");
        }
    }
}

[Buggy Hunk]
private void obeyOrder(Order order) {

[Patch]
private void obeyOrder(Order order) throws NotEnoughKnowledgeException {

[Demonstration 3]

[Buggy Method]
@Override
public void run(TaskListener listener) {
    listener.log("Fetching changelog");
    StringBuilder sb = new StringBuilder();
    try {
        InputStreamReader in = new InputStreamReader(new URL(config.changelogUrl).openStream());
        try {
            BufferedReader buf = new BufferedReader(in);
            String line;
            while ((line = buf.readLine()) != null) {
                sb.append(line).append("\n");
            }
            changelog = sb.toString();
        } finally {
            in.close();
        }
    } catch (Exception ex) {
        listener.log("Couldn't fetch changelog: " + ex.getMessage());
    }
}

[Buggy Hunk]
listener.log("Fetching changelog");

[Patch]
listener.step("Fetching changelog...");