[Demonstration 1]

[Buggy Method]
public boolean remove(Integer id) {
    BasicDBObject doc = new BasicDBObject();
    doc.put("sessionId", id);
    DBObject result = devices.findOne(doc);
    if (result != null) {
        devices.remove(doc);
        log.log(Level.INFO, "Removed device " + id + " from the database.");
        return true;
    } else {
        log.log(Level.INFO, "Cannot delete device as it is not in the collection");
        return false;
    }
}

[Buggy Hunk]
log.log(Level.INFO, "Cannot delete device as it is not in the collection");

[Patch]
log.log(Level.INFO, "Cannot delete device " + id + " as it is not in the collection");

[Demonstration 2]

[Buggy Method]
protected void addRelationshipUpdate(Serializable parentId, Association association, Serializable id, Map<RelationshipUpdateKey, Collection<Serializable>> targetMap) {
    final RelationshipUpdateKey key = new RelationshipUpdateKey(parentId, association);
    Collection<Serializable> inserts = targetMap.get(key);
    if (inserts == null) {
        inserts = new ConcurrentLinkedQueue<Serializable>();
        targetMap.put(key, inserts);
    }
    inserts.add(id);
}

[Buggy Hunk]
inserts = new ConcurrentLinkedQueue<Serializable>();

[Patch]
inserts = new ConcurrentLinkedQueue<>();

[Demonstration 3]

[Buggy Method]
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    LogInController lc = new LogInController();
    CampaignController cc = new CampaignController();
    try {
        String derp = lc.FetchPartners(request.getParameter("lid"), request.getParameter("pass"));
        String herp = lc.FetchDell(request.getParameter("lid"), request.getParameter("pass"));
        String herpderp = lc.FetchFinance(request.getParameter("lid"), request.getParameter("pass"));
        request.getSession().setAttribute("Selected", "null");
        if (derp != null) {
            if (cc.CheckPartner(request.getParameter("lid"))) {
                request.getSession().setAttribute("id", derp);
                response.sendRedirect("PartnerFetch");
            } else {
                Partner p = cc.GetPartner(derp);
                request.getSession().setAttribute("part", p);
                response.sendRedirect("EditPartner.jsp");
            }
        } else if (herp != null) {
            request.getSession().setAttribute("id", herp);
            response.sendRedirect("DellFetch");
        } else if (herpderp != null) {
            request.getSession().setAttribute("id", herpderp);
            response.sendRedirect("FinanceFetch");
        } else {
            response.sendRedirect("index.jsp?msg=Incorrect username or password");
        }
    } catch (Exception ex) {
        ex.printStackTrace();
        response.sendRedirect("index.jsp?msg=Error: " + ex.getMessage());
    }
}

[Buggy Hunk]
if(cc.CheckPartner(request.getParameter("lid"))){

[Patch]
if(cc.CheckPartner(derp)){