[Demonstration 1]

[Buggy Method]
private void markNodeAsSent(NodeRef nodeRef, String authenticatedUserName, List<String> to, List<String> cc, List<String> bcc, String subject) {
    NodeService nodeService = getServiceRegistry().getNodeService();
    try {
        Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
        properties.put(ContentModel.PROP_ORIGINATOR, authenticatedUserName);
        properties.put(ContentModel.PROP_ADDRESSEE, String.format("%s,%s,%s", String.join(",", to), String.join(",", cc), String.join(",", bcc)));
        properties.put(ContentModel.PROP_SUBJECT, subject);
        properties.put(ContentModel.PROP_SENTDATE, new Date());
        nodeService.addAspect(nodeRef, ContentModel.ASPECT_EMAILED, properties);
    } catch (Exception e) {
        String errorMessage = "Error occured whilst marking news-flash as sent. " + e.getMessage();
        logger.error(errorMessage);
        throw new BpmnError("newsFlashError", errorMessage);
    }
}

[Buggy Hunk]
properties.put( ContentModel.PROP_ADDRESSEE , String.format( "%s,%s,%s" , String.join( "," , to ) , String.join( "," , cc ) , String.join( "," , bcc ) ) );

[Patch]
properties.put( ContentModel.PROP_ADDRESSEE , String.format( "%s,%s,%s" , ( ( to != null ) ? String.join( "," , to ) : "" ) ,  ( ( cc != null ) ? String.join( "," , cc ) : "" ) ,  ( ( bcc != null ) ? String.join( "," , bcc ) : "" ) ) );

[Demonstration 2]

[Buggy Method]
public ReservedEvent switchToReservedParameters() {
    ReservedEvent newEvent = new ReservedEvent();
    newEvent.setName(checkNameParameter(originalEvent.getName()));
    newEvent.setLocation(checkLocationParameter(originalEvent.getLocation()));
    newEvent.setDescription(checkDescriptionParameter(originalEvent.getDescription()));
    newEvent.setCategory(checkCategoryParameter(originalEvent.getCategory()));
    newEvent.setStatus(checkStatusParameter(originalEvent.getStatus()));
    newEvent.setReservedTimes(((ReservedEvent) originalEvent).getReservedTimes());
    return newEvent;
}

[Buggy Hunk]
newEvent.setStatus(checkStatusParameter(originalEvent.getStatus()));

[Patch]
newEvent.setStatus(Status.UNDETERMINED);

[Demonstration 3]

[Buggy Method]
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
    if (dataSnapshot.getValue() != null) {
        if ((boolean) dataSnapshot.getValue() == true) {
            fbRefWaitingTime.removeEventListener(waitingTimeListener);
            fbRefQueueTurn.removeEventListener(queueTurnListener);
            waitingTime_TV.setText("Your turn's up!");
            refresh_btn.setVisibility(View.INVISIBLE);
            claim_btn.setVisibility(View.VISIBLE);
        }
    }
}

[Buggy Hunk]
if((boolean) dataSnapshot.getValue() == true)

[Patch]
if((boolean) dataSnapshot.getValue())