[Demonstration 1]

[Buggy Method]
boolean persistManagedSchema(boolean createOnly) {
    if (loader instanceof ZkSolrResourceLoader) {
        return persistManagedSchemaToZooKeeper(createOnly);
    }
    // Persist locally
    File managedSchemaFile = new File(loader.getConfigDir(), managedSchemaResourceName);
    OutputStreamWriter writer = null;
    try {
        File parentDir = managedSchemaFile.getParentFile();
        if (!parentDir.isDirectory()) {
            if (!parentDir.mkdirs()) {
                final String msg = "Can't create managed schema directory " + parentDir.getAbsolutePath();
                log.error(msg);
                throw new SolrException(ErrorCode.SERVER_ERROR, msg);
            }
        }
        final FileOutputStream out = new FileOutputStream(managedSchemaFile);
        writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
        persist(writer);
        log.info("Upgraded to managed schema at " + managedSchemaFile.getPath());
    } catch (IOException e) {
        final String msg = "Error persisting managed schema " + managedSchemaFile;
        log.error(msg, e);
        throw new SolrException(ErrorCode.SERVER_ERROR, msg, e);
    } finally {
        IOUtils.closeQuietly(writer);
        try {
            FileUtils.sync(managedSchemaFile);
        } catch (IOException e) {
            final String msg = "Error syncing the managed schema file " + managedSchemaFile;
            log.error(msg, e);
        }
    }
    return true;
}

[Buggy Hunk]
boolean persistManagedSchema(boolean createOnly) {

[Patch]
public boolean persistManagedSchema(boolean createOnly) {

[Demonstration 2]

[Buggy Method]
@Override
protected ContactData doInBackground(Void... args) {
    ContentResolver resolver = mContext.getContentResolver();
    ContactData result = new ContactData();
    // Undo the lookup URI
    Uri contactUri = null;
    if (mLookupUri != null) {
        mLookupUri = Contacts.getLookupUri(resolver, mLookupUri);
        if (mLookupUri != null) {
            contactUri = Contacts.lookupContact(resolver, mLookupUri);
        }
    }
    if (contactUri == null) {
        return null;
    }
    result.uri = contactUri;
    // Read available social rows
    final Uri dataUri = Uri.withAppendedPath(contactUri, Contacts.Data.CONTENT_DIRECTORY);
    Cursor cursor = resolver.query(dataUri, StatusQuery.PROJECTION, StatusUpdates.PRESENCE + " IS NOT NULL OR " + StatusUpdates.STATUS + " IS NOT NULL", null, null);
    if (cursor != null) {
        try {
            HashMap<Long, DataStatus> statuses = Maps.newHashMap();
            // Walk found statuses, creating internal row for each
            while (cursor.moveToNext()) {
                final DataStatus status = new DataStatus(cursor);
                final long dataId = cursor.getLong(StatusQuery._ID);
                statuses.put(dataId, status);
            }
            result.statuses = statuses;
        } finally {
            cursor.close();
        }
    }
    // Read out the info about the display name
    cursor = resolver.query(dataUri, new String[] { Contacts.NAME_RAW_CONTACT_ID, Contacts.DISPLAY_NAME_SOURCE }, null, null, null);
    if (cursor != null) {
        try {
            if (cursor.moveToFirst()) {
                result.nameRawContactId = cursor.getLong(cursor.getColumnIndex(Contacts.NAME_RAW_CONTACT_ID));
                result.displayNameSource = cursor.getInt(cursor.getColumnIndex(Contacts.DISPLAY_NAME_SOURCE));
            }
        } finally {
            cursor.close();
        }
    }
    // Read the constituent raw contacts
    final long contactId = ContentUris.parseId(contactUri);
    cursor = resolver.query(RawContactsEntity.CONTENT_URI, null, RawContacts.CONTACT_ID + "=" + contactId, null, null);
    if (cursor != null) {
        ArrayList<Entity> entities = Lists.newArrayList();
        EntityIterator iterator = RawContacts.newEntityIterator(cursor);
        try {
            while (iterator.hasNext()) {
                Entity entity = iterator.next();
                entities.add(entity);
            }
        } finally {
            iterator.close();
        }
        result.entities = entities;
    }
    return result;
}

[Buggy Hunk]
ContentResolver resolver = mContext.getContentResolver();

[Patch]
ContentResolver resolver = getContext().getContentResolver();

[Demonstration 3]

[Buggy Method]
TestInformation createTestInformation(int testNum) {
    return new TestInformation("seleniumSessionId-" + testNum, "testName-" + testNum, "proxyName", "browser", "browserVersion", "platform");
}

[Buggy Hunk]
TestInformation createTestInformation(int testNum) {

[Patch]
protected TestInformation createTestInformation(int testNum) {