[Demonstration 1]

[Buggy Method]
public void addHeader(String name, String value) {
    if (SET_COOKIE_NAME == name) {
        addCookie(value);
        return;
    }
    if (headers.containsKey(name)) {
        String message = String.format("Header name: \"%s\" is already in use.", name);
        throw new DuplicateHeaderException(message);
    }
    headers.put(name, value);
}

[Buggy Hunk]
if (SET_COOKIE_NAME == name) {

[Patch]
if (SET_COOKIE_NAME.equals(name)) {

[Demonstration 2]

[Buggy Method]
public TreeNode setChildren(TreeNode[] children) {
    if (children.length == 2) {
        this.children = children;
        return this;
    }
    throw new IllegalArgumentException("\t[EE] Children array of TreeNode has to have length 1 or 2");
}

[Buggy Hunk]
this.children = children;

[Patch]
this.children = children.clone();

[Demonstration 3]

[Buggy Method]
public void registerBlog(String name, final String pattern, final Layouts layouts, Map<String, Object> context) {
    if (!doesBlogExist(name)) {
        LOGGER.error("Cannot register blog. The blog with the name \"" + name + "\" does not exist!");
        return;
    }
    final Blog blog = blogs.get(name);
    blog.setLayouts(layouts);
    blog.putAllContext(context);
    blog.url = pattern;
    preparePostings(blog, pattern);
    final Map<String, Post> posts = blog.getPosts();
    for (final Map.Entry<String, Post> entry : posts.entrySet()) {
        String route = pattern + entry.getKey();
        final Post post = entry.getValue();
        blog.addCategory(post.getFrontMatter().get(Constants.CATEGORIES_ID));
        //Route checking here?
        //Router router = application.getRouter();
        //List<Route> routes = router.getRoutes();
        application.GET(route, new RouteHandler() {

            @Override
            public void handle(RouteContext routeContext) {
                final Map<String, Object> context = blog.getContext();
                context.putAll(post.getContext());
                context.put("content", post.getContent());
                context.put("post", post.getFrontMatter());
                context.put("blog", blog.globalContext);
                context.put("blogUrl", blog.url);
                routeContext.render(post.getLayout(), context);
            }
        });
    }
    registerBlogPage(blog, pattern);
    registerBlogAuthors(blog, pattern);
    registerAuthorsPage(blog, pattern);
    registerCategories(blog, pattern);
    registerStaticPages(blog, pattern);
}

[Buggy Hunk]
LOGGER.error("Cannot register blog. The blog with the name \"" + name + "\" does not exist!");

[Patch]
LOGGER.error("Cannot register blog. The blog with the name \"{}\" does not exist!", name);