[Demonstration 1]

[Buggy Method]
@Override
public IType check(Context context) {
    IType sourceType = source.check(context);
    if (!(sourceType instanceof ContainerType))
        throw new SyntaxError("Expecting a list, set or tuple as data source !");
    Context local = context.newLocalContext();
    IType itemType = ((ContainerType) sourceType).getItemType();
    local.registerValue(new Variable(itemName, itemType));
    IType filterType = predicate.check(local);
    if (filterType != BooleanType.instance())
        throw new SyntaxError("Filtering expression must return a boolean !");
    return new ListType(itemType);
}

[Buggy Hunk]
Context local = context.newLocalContext();

[Patch]
Context local = context.newChildContext();

[Demonstration 2]

[Buggy Method]
@Override
public void enterInterfaceDeclaration(JavaParser.InterfaceDeclarationContext ctx) {
    canCouple = false;
    // The second child is the class name.
    if (!location.isEmpty()) {
        outerClass = location.peek();
    }
    String cName = ctx.getChild(1).getText();
    if (!outerClass.equals("")) {
        cName = outerClass + ":" + cName;
    }
    location.push(cName);
    classes.add(cName);
}

[Buggy Hunk]
classes.add(cName);

[Patch]
classes.put(cName, canCouple);

[Demonstration 3]

[Buggy Method]
@Test
public void test() throws IOException, ParseException {
    byte[] bytes = CodecTestUtil.readBinaryFile("/tgsreq.token");
    TgsReq tgsReq = new TgsReq();
    tgsReq.decode(bytes);
    Assert.assertEquals(5, tgsReq.getPvno());
    Assert.assertEquals(KrbMessageType.TGS_REQ, tgsReq.getMsgType());
    PaData paData = tgsReq.getPaData();
    Assert.assertEquals(1, paData.getElements().size());
    PaDataEntry entry = paData.getElements().iterator().next();
    Assert.assertEquals(PaDataType.TGS_REQ, entry.getPaDataType());
    //request body
    KdcReqBody body = tgsReq.getReqBody();
    Assert.assertEquals(0, body.getKdcOptions().getPadding());
    byte[] kdcOptionsValue = { 64, (byte) 128, 0, 0 };
    Assert.assertArrayEquals(kdcOptionsValue, body.getKdcOptions().getValue());
    Assert.assertEquals("DENYDC.COM", body.getRealm());
    PrincipalName sName = body.getSname();
    Assert.assertEquals(NameType.NT_SRV_HST, sName.getNameType());
    Assert.assertThat(sName.getNameStrings(), allOf(hasItem("host"), hasItem("xp1.denydc.com")));
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
    sdf.setTimeZone(new SimpleTimeZone(0, "Z"));
    Date date = sdf.parse("20370913024805");
    Assert.assertEquals(date.getTime(), body.getTill().getTime());
    Assert.assertEquals(197296424, body.getNonce());
    List<EncryptionType> eTypes = body.getEtypes();
    Assert.assertEquals(7, eTypes.size());
    Assert.assertEquals(eTypes.get(0), anyOf(is(EncryptionType.ARCFOUR_HMAC), is(EncryptionType.RC4_HMAC), is(EncryptionType.ARCFOUR_HMAC_MD5)));
    //Assert.assertEquals(-133, eTypes.get(1).getValue());//FIXME
    //Assert.assertEquals(-128, eTypes.get(2).getValue());//FIXME
    Assert.assertThat(eTypes.get(3), anyOf(is(EncryptionType.DES_CBC_MD5), is(EncryptionType.DES)));
    Assert.assertEquals(EncryptionType.DES_CBC_CRC, eTypes.get(4));
    Assert.assertThat(eTypes.get(5), anyOf(is(EncryptionType.ARCFOUR_HMAC_EXP), is(EncryptionType.RC4_HMAC_EXP), is(EncryptionType.ARCFOUR_HMAC_MD5_EXP)));
    //Assert.assertEquals(-135, eTypes.get(6).getValue());//FIXME
}

[Buggy Hunk]
Assert.assertEquals(eTypes.get(0), anyOf(

[Patch]
Assert.assertThat(eTypes.get(0), anyOf(