[Demonstration 1]

[Buggy Method]
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_container);
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
        Fragment f = FragmentSwitchboard.newInstance(bundle);
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
        ft.replace(R.id.fragment_target, f);
        ft.commit();
    }
}

[Buggy Hunk]
if (bundle != null) {

[Patch]
if (bundle.containsKey(WFScanResult.BUNDLE_KEY)) {

[Demonstration 2]

[Buggy Method]
public boolean isElementPresent(By by) {
    try {
        driver.findElement(by);
        return true;
    } catch (NoSuchElementException e) {
        return false;
    }
}

[Buggy Hunk]
driver.findElement(by);

[Patch]
driver.findElements(by);

[Demonstration 3]

[Buggy Method]
public void getTopic(String category, final List<Course> courses, final int container) {
    CoursesListFragment topicListFragment = CoursesListFragment.newInstance(category, courses, CoursesListFragment.Type.NEW);
    FragmentActivity activity = getActivity();
    if (activity != null) {
        FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
        ft.replace(container, topicListFragment);
        ft.commit();
    }
    //
}

[Buggy Hunk]
FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();

[Patch]
FragmentTransaction ft = getChildFragmentManager().beginTransaction();