[Demonstration 1]

[Buggy Method]
public static void logShortestPaths(Map costs) {
    Iterator iter = costs.keySet().iterator();
    while (iter.hasNext()) {
        Integer dest = (Integer) iter.next();
        Double cost = (Double) costs.get(dest);
        Object[] destCost = { dest, cost };
        log.info(MessageFormat.format("d({0,number,integer})={1,number,integer}", destCost));
    }
}

[Buggy Hunk]
Integer dest = (Integer)iter.next();

[Patch]
Comparable dest = (Comparable)iter.next();

[Demonstration 2]

[Buggy Method]
private void handleCommand() {
    ProfileObject object = commandObject.guild.users.getUserByID(author.getStringID());
    if (object != null && object.getSettings().contains(UserSetting.DENY_USE_CCS)) {
        Utility.sendMessage("> Nothing interesting happens. `(ERROR: 401)`", channel);
        return;
    }
    String response;
    String prefixEmbedImage = "<embedImage>{";
    String tagDeleteMessage = "<delCall>";
    for (CCommandObject cc : customCommands.getCommandList()) {
        if (command.equalsIgnoreCase(guildconfig.getPrefixCC() + cc.getName())) {
            //command logging
            logger.debug(Utility.loggingFormatter(commandObject, "CUSTOM_COMMAND"));
            if (Utility.canBypass(author, guild))
                ;
            else if (cc.isShitPost() && guildconfig.shitPostFiltering) {
                ArrayList<String> channelMentions = new ArrayList<>();
                boolean isShitpost = false;
                if (guildconfig.getChannelIDsByType(Command.CHANNEL_SHITPOST) != null) {
                    for (ChannelSetting c : commandObject.guild.channelSettings) {
                        if (c.type().equals(Command.CHANNEL_SHITPOST)) {
                            for (String id : c.getIDs(commandObject.guild.config)) {
                                if (commandObject.channel.stringID.equals(id)) {
                                    isShitpost = true;
                                }
                                for (IChannel channel : commandObject.guild.get().getChannels()) {
                                    if (id.equals(channel.getStringID())) {
                                        EnumSet<Permissions> userPerms = channel.getModifiedPermissions(commandObject.user.get());
                                        if (userPerms.contains(Permissions.SEND_MESSAGES) && userPerms.contains(Permissions.READ_MESSAGES)) {
                                            channelMentions.add(channel.mention());
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (!isShitpost) {
                        if (channelMentions.size() == 0) {
                            Utility.sendMessage("> You do not have access to any channels that you are able to run this command in.", channel);
                            return;
                        } else if (channelMentions.size() > 1) {
                            Utility.sendMessage("> Command must be performed in any of the following channels: \n" + Utility.listFormatter(channelMentions, true), channel);
                            return;
                        } else if (channelMentions.size() == 1) {
                            Utility.sendMessage("> Command must be performed in: " + channelMentions.get(0), channel);
                            return;
                        }
                    }
                }
            }
            response = cc.getContents(true);
            int argsCount = StringUtils.countMatches(response, "<args>");
            if (argsCount != 0) {
                if (args.length() * argsCount > Globals.argsMax) {
                    Utility.sendMessage("> Args to large for this command. Max args size : " + Globals.argsMax, channel);
                    return;
                }
            }
            response = TagHandler.tagSystem(response, commandObject, args);
            response = TagHandler.tagMentionRemover(response);
            response = response.replace("<DELCALL>", "<delCall>");
            response = response.replace("<EMBEDIMAGE>", "<embedImage>");
            if (customCommands.checkblackList(response) != null) {
                Utility.sendMessage(customCommands.checkblackList(response), channel);
                return;
            }
            if (response.contains(tagDeleteMessage)) {
                response = response.replace(tagDeleteMessage, "");
                Utility.deleteMessage(message);
            }
            if (response.contains("<embedImage>{")) {
                String imageURL = TagHandler.tagEmbedImage(response, prefixEmbedImage);
                if (imageURL != null || !imageURL.isEmpty()) {
                    if (commandObject.channel.get().getModifiedPermissions(author).contains(Permissions.EMBED_LINKS)) {
                        response = response.replaceFirst(Pattern.quote(prefixEmbedImage + imageURL + "}"), "");
                        response = TagHandler.tagToCaps(response);
                        Utility.sendFileURL(response, imageURL, channel, true);
                    } else {
                        response = response.replaceFirst(Pattern.quote(prefixEmbedImage + imageURL + "}"), "<" + imageURL + ">");
                        Utility.sendMessage(response, channel);
                    }
                    return;
                }
            }
            Utility.sendMessage(response, channel);
        }
    }
}

[Buggy Hunk]
if (imageURL != null || !imageURL.isEmpty()) {

[Patch]
if (imageURL != null && !imageURL.isEmpty()) {

[Demonstration 3]

[Buggy Method]
public String getImageTitle() {
    int rand = (int) (Math.random() * 5) + 1;
    String result = "";
    if (weatherInfo.getMain() != "Rain") {
        result = "rain" + rand;
    } else {
        if (weatherInfo.getWindSpeed() > WIND_TRESHOLD) {
            result = "wind" + rand;
        } else {
            if (weatherInfo.getTemperature() > HOT_TRESHOLD) {
                result = "hot_weather" + rand;
            } else if (weatherInfo.getTemperature() < COLD_TRESHOLD) {
                result = "cold_weather" + rand;
            } else if (weatherInfo.getTemperature() < CHILLY_TRESHOLD) {
                result = "chilly" + rand;
            } else {
                result = "neutral" + rand;
            }
        }
    }
    return result;
}

[Buggy Hunk]
if (weatherInfo.getMain() != "Rain") {

[Patch]
if (weatherInfo.getMain().equals("Rain")) {