[Demonstration 1]

[Buggy Method]
private Map<String, Object> getRouteMap() {
    return routeMap;
}

[Buggy Hunk]
private Map<String,Object> getRouteMap() {

[Patch]
private static Map<String,Object> getRouteMap() {

[Demonstration 2]

[Buggy Method]
private void writeBadnicks() {
    try {
        List<String> lines = badnicks.entrySet().stream().map(entry -> entry.getValue().severity + entry.getKey().toString() + " " + entry.getValue().reason).collect(Collectors.toList());
        Files.write(BADNICK_FILE, lines);
    } catch (IOException e) {
        log.error("Error while writing badnicks", e);
    }
}

[Buggy Hunk]
+ entry.getKey().toString() + " " + entry.getValue().reason)

[Patch]
+ entry.getKey().pattern().substring(1, entry.getKey().pattern().length() -1) + " " + entry.getValue().reason)

[Demonstration 3]

[Buggy Method]
@Override
public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent) throws CommitValidationException {
    List<CommitValidationMessage> messages = new LinkedList<>();
    try {
        Project.NameKey project = receiveEvent.project.getNameKey();
        PluginConfig cfg = cfgFactory.getFromProjectConfigWithInheritance(project, pluginName);
        if (isActive(cfg)) {
            try (Repository repo = repoManager.openRepository(project)) {
                String name = getOwnersFileName(project);
                messages = performValidation(repo, receiveEvent.commit, receiveEvent.revWalk, name, false);
            }
        }
    } catch (NoSuchProjectException | IOException | ExecutionException e) {
        throw new CommitValidationException("failed to check owners files", e);
    }
    if (hasError(messages)) {
        throw new CommitValidationException("found invalid owners file", messages);
    }
    return messages;
}

[Buggy Hunk]
performValidation(repo, receiveEvent.commit, receiveEvent.revWalk, name, false);

[Patch]
performValidation(receiveEvent.commit, receiveEvent.revWalk, name, false);