[Demonstration 1]

[Buggy Method]
private EnumSet<Modifier> buildModifiers(int access) {
    EnumSet<Modifier> modifiers = EnumSet.noneOf(Modifier.class);
    if (hasFlag(access, ACC_PUBLIC))
        modifiers.add(Modifier.PUBLIC);
    if (hasFlag(access, ACC_PUBLIC))
        modifiers.add(Modifier.PROTECTED);
    if (hasFlag(access, ACC_PRIVATE))
        modifiers.add(Modifier.PRIVATE);
    if (hasFlag(access, ACC_ABSTRACT))
        modifiers.add(Modifier.ABSTRACT);
    if (hasFlag(access, ACC_STATIC))
        modifiers.add(Modifier.STATIC);
    if (hasFlag(access, ACC_TRANSIENT))
        modifiers.add(Modifier.TRANSIENT);
    if (hasFlag(access, ACC_VOLATILE))
        modifiers.add(Modifier.VOLATILE);
    if (hasFlag(access, ACC_SYNCHRONIZED))
        modifiers.add(Modifier.SYNCHRONIZED);
    if (hasFlag(access, ACC_NATIVE))
        modifiers.add(Modifier.NATIVE);
    if (hasFlag(access, ACC_STRICT))
        modifiers.add(Modifier.STRICTFP);
    return modifiers;
}

[Buggy Hunk]
if (hasFlag(access, ACC_PUBLIC)) modifiers.add(Modifier.PROTECTED);

[Patch]
if (hasFlag(access, ACC_PROTECTED)) modifiers.add(Modifier.PROTECTED);

[Demonstration 2]

[Buggy Method]
@Test
public void testInsert() {
    LocationDAO d = new LocationDAO();
    boolean isWorking = d.insertLocation("Testloc", "Test", "7777777", "Thomas", "Memphis", "US", 10);
    assertEquals(isWorking, true);
}

[Buggy Hunk]
public void testInsert()

[Patch]
public void testInsert() throws SQLException

[Demonstration 3]

[Buggy Method]
public void createCachedPattern(TLFunctionCallContext context, int position) {
    if (context.getLiteralsSize() > position && context.isLiteral(position)) {
        String regexp = (String) context.getParamValue(position);
        try {
            cachedPattern = Pattern.compile(regexp);
            cachedMatcher = cachedPattern.matcher("");
        } catch (PatternSyntaxException ex) {
            String message = String.format("Invalid regular expression: \"%s\" (%s)", regexp, ex.getMessage());
            throw new TransformLangExecutorRuntimeException(message);
        }
    }
}

[Buggy Hunk]
cachedPattern = Pattern.compile(regexp);

[Patch]
cachedPattern = compilePattern(regexp);