[Demonstration 1]

[Buggy Method]
private void viewSetting() {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), null);
    pttWebView = (WebView) findViewById(R.id.ptt_webview);
    pttWebView.getSettings().setJavaScriptEnabled(true);
    pttWebView.getSettings().setLoadWithOverviewMode(true);
    pttWebView.getSettings().setAllowFileAccess(true);
    // Disable zooming and fit web content to screen size.
    pttWebView.getSettings().setUseWideViewPort(true);
    pttWebView.setWebViewClient(new WebViewClient() {

        ProgressDialog progressDialog;

        //If you will not use this method url links are open in new browser not in webview
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }

        //Show loader on url load
        public void onLoadResource(WebView view, String url) {
            if (progressDialog == null) {
                // in standard case YourActivity.this
                progressDialog = new ProgressDialog(TopicContentActivity.this);
                progressDialog.setMessage("Loading...");
                progressDialog.show();
            }
        }

        public void onPageFinished(WebView view, String url) {
            try {
                if (progressDialog.isShowing()) {
                    progressDialog.dismiss();
                    progressDialog = null;
                }
            } catch (Exception exception) {
                exception.printStackTrace();
            }
        }
    });
    if (!targetLanguage.equals("zh-TW")) {
        contentUrl = "http://translate.google.com.tw/translate?hl=" + targetLanguage + "&sl=zh-TW&u=" + contentUrl;
        Log.e(LOG_TAG, contentUrl);
    }
    pttWebView.loadUrl(contentUrl);
}

[Buggy Hunk]
targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), null);

[Patch]
targetLanguage = prefs.getString(getResources().getString(R.string.pref_language_key), getResources().getString(R.string.pref_language_zhTW));

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("ConstantConditions")
@Test
public void onCreate_shouldShowActionBar() {
    ActionBar actionBar = mActivity.getSupportActionBar();
    assertThat(actionBar).isNotNull();
    assertThat(actionBar.isShowing()).isTrue();
    assertThat(actionBar.getTitle()).isEqualTo(RuntimeEnvironment.application.getString(R.string.activity));
}

[Buggy Hunk]
R.string.activity));

[Patch]
R.string.news_feed));

[Demonstration 3]

[Buggy Method]
private void updateBluetoothTetherSummary() {
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    String savedAddress = sharedPreferences.getString(getString(R.string.pref_bluetooth_tether_address), "");
    BluetoothDevice device = null;
    try {
        device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(savedAddress);
    } catch (IllegalArgumentException ignored) {
    }
    String deviceName = getActivity().getString(R.string.bluetooth_tether_no_device_set);
    if (device != null) {
        deviceName = device.getName();
    } else if (!savedAddress.isEmpty()) {
        // The previously saved devices has unpaired
        sharedPreferences.edit().putString(getString(R.string.pref_bluetooth_tether_address), "").apply();
    }
    bluetoothTetherPreference.setSummary(getString(R.string.bluetooth_tether_address_summary, deviceName));
}

[Buggy Hunk]
} catch (IllegalArgumentException ignored) {}

[Patch]
} catch (IllegalArgumentException | NullPointerException ignored) {}