[Demonstration 1]

[Buggy Method]
@Override
public void cleanAllActivityInfos() {
    Observable.create(new Observable.OnSubscribe<Void>() {

        @Override
        public void call(Subscriber<? super Void> subscriber) {
            mActivityInfosRepository.deleteAllActivityInfos();
            subscriber.onCompleted();
        }
    }).observeOn(mSchedulerProvider.io()).subscribe();
}

[Buggy Hunk]
.observeOn(mSchedulerProvider.io())

[Patch]
.subscribeOn(mSchedulerProvider.io())

[Demonstration 2]

[Buggy Method]
@Override
public void onCreate() {
    super.onCreate();
    sInstance = this;
    Connection.setContext(getApplicationContext());
    // Error Reporter
    CustomExceptionHandler customExceptionHandler = CustomExceptionHandler.getInstance();
    customExceptionHandler.init(sInstance.getApplicationContext());
    Thread.setDefaultUncaughtExceptionHandler(customExceptionHandler);
    SharedPreferences preferences = PrefSettings.getSharedPrefs(this);
    // Assign some default settings if necessary
    if (preferences.getString(PrefSettings.KEY_CHECK_URI, null) == null) {
        Editor editor = preferences.edit();
        // Test Update Notifications
        // Some ridiculously fast polling, just to demonstrate it working...
        /*
             * editor.putBoolean(PrefSettings.KEY_ENABLED, true); editor.putLong(PrefSettings.KEY_PERIOD, 30 * 1000L);
             * editor.putLong(PrefSettings.KEY_CHECK_INTERVAL, 60 * 1000L); editor.putString(PrefSettings.KEY_CHECK_URI,
             * "http://ankidroid.googlecode.com/files/test_notifications.xml");
             */
        editor.putString(PrefSettings.KEY_CHECK_URI, "http://ankidroid.googlecode.com/files/last_release.xml");
        // Create the folder "AnkiDroid", if not exists, where the decks
        // will be stored by default
        String deckPath = getDefaultAnkiDroidDirectory();
        createDecksDirectoryIfMissing(new File(deckPath));
        // Put the base path in preferences pointing to the default
        // "AnkiDroid" folder
        editor.putString("deckPath", deckPath);
        // Using commit instead of apply even though we don't need a return value.
        // Reason: apply() not available on Android 1.5
        editor.commit();
    }
    // Reschedule the checks - we need to do this if the settings have
    // changed (as above)
    // It may also necessary in the case where an application has been
    // updated
    // Here for simplicity, we do it every time the application is launched
    // Intent intent = new Intent(Veecheck.getRescheduleAction(this));
    // sendBroadcast(intent);
}

[Buggy Hunk]
createDecksDirectoryIfMissing(new File(deckPath));

[Patch]
createDirectoryIfMissing(new File(deckPath));

[Demonstration 3]

[Buggy Method]
private File absentFile() {
    try {
        File result = new File(existingDirectory() + filename);
        Files.deleteIfExists(result.toPath());
        return result;
    } catch (IOException ex) {
        throw new IllegalStateException(ex);
    }
}

[Buggy Hunk]
File result = new File(existingDirectory() + filename);

[Patch]
File result = new File(existingDirectory().toString() + HandyPath.PATH_SEPARATOR + filename);