[Demonstration 1]

[Buggy Method]
private static long parseByteString(String str, ByteUnit unit) {
    String lower = str.toLowerCase().trim();
    try {
        Matcher m = Pattern.compile("([0-9]+)([a-z]+)?").matcher(lower);
        Matcher fractionMatcher = Pattern.compile("([0-9]*\\.[0-9]*)([a-z]+)?").matcher(lower);
        if (m.matches()) {
            long val = Long.parseLong(m.group(1));
            String suffix = m.group(2);
            // Check for invalid suffixes
            if (suffix != null && !byteSuffixes.containsKey(suffix)) {
                throw new NumberFormatException("Invalid suffix: \"" + suffix + "\"");
            }
            // If suffix is valid use that, otherwise none was provided and use the default passed
            return unit.interpret(val, suffix != null ? byteSuffixes.get(suffix) : unit);
        } else if (fractionMatcher.matches()) {
            double val = Long.parseLong(m.group(1));
            throw new NumberFormatException("Fractional values are not supported. Input was: " + val);
        } else {
            throw new NumberFormatException("Failed to parse byte string: " + str);
        }
    } catch (NumberFormatException e) {
        String timeError = "Size must be specified as bytes (b), " + "kibibytes (k), mebibytes (m), gibibytes (g), tebibytes (t), or pebibytes(p). " + "E.g. 50b, 100k, or 250m.";
        throw new NumberFormatException(timeError + "\n" + e.getMessage());
    }
}

[Buggy Hunk]
double val = Long.parseLong(m.group(1));

[Patch]
double val = Double.parseDouble(fractionMatcher.group(1));

[Demonstration 2]

[Buggy Method]
void setTesting(boolean testing) {
    this.testing = testing;
}

[Buggy Hunk]
void setTesting(boolean testing) {

[Patch]
synchronized void setTesting(boolean testing) {

[Demonstration 3]

[Buggy Method]
@Override
public int compare(Message m1, Message m2) {
    return Long.valueOf(m1.time_sent).compareTo(Long.valueOf(m2.time_sent));
}

[Buggy Hunk]
return Long.valueOf(m1.time_sent).compareTo(Long.valueOf(m2.time_sent));

[Patch]
return Long.valueOf(m1.time_sent).compareTo(m2.time_sent);