[Demonstration 1]

[Buggy Method]
public Uri getUriFromFilePath(Uri uriType, String filePath) {
    try {
        Cursor cursor = context.getContentResolver().query(uriType, new String[] { MediaStore.Audio.Media._ID }, MediaStore.Audio.Media.DATA + "=? ", new String[] { filePath }, null);
        if (cursor != null && cursor.moveToFirst()) {
            int id = cursor.getInt(cursor.getColumnIndex(MediaStore.MediaColumns._ID));
            cursor.close();
            return Uri.withAppendedPath(uriType, "" + id);
        }
    } catch (Exception e) {
    }
    return null;
}

[Buggy Hunk]
public Uri getUriFromFilePath(Uri uriType, String filePath) {

[Patch]
public static Uri getUriFromFilePath(Uri uriType, String filePath) {

[Demonstration 2]

[Buggy Method]
public static boolean hasFilteredDealerships(DBHelper dbh, String userId) {
    Cursor c = null;
    SQLiteDatabase db = dbh.getReadableDatabase();
    boolean result = false;
    try {
        String query = "select * from " + DBHelper.DEALERSHIPS_SELECTED_TABLE_NAME + " where " + DEALERSHIPS_COLUMN_USER_ID + " = ?";
        c = db.rawQuery(query, new String[] { userId });
        int count = c.getCount();
        boolean test = count > 1;
        if (test) {
            result = true;
        }
    } finally {
        if (c != null) {
            c.close();
        }
        if (db != null) {
            db.close();
        }
        return result;
    }
}

[Buggy Hunk]
boolean test = count > 1;

[Patch]
boolean test = count > 0;

[Demonstration 3]

[Buggy Method]
private static void handleViewFocused(AccessibilityEvent event, AccessibilityNodeInfo view) {
    if (view != null) {
        if (!view.isFocused()) {
            setCurrentNode(event);
        }
    }
}

[Buggy Hunk]
if (!view.isFocused()) {

[Patch]
if (view.isFocused()) {