shadows/supportv4/src/main/java/org/robolectric/shadows/support/v4/SupportFragmentController.java
public static <F extends Fragment> F setupFragment(
      F fragment, Class<? extends FragmentActivity> fragmentActivityClass) {
    return SupportFragmentController.of(fragment, fragmentActivityClass)
        .create()
        .start()
        .resume()
        .visible()
        .get();
  }
public static <F extends Fragment> F setupFragment(
      F fragment, Class<? extends FragmentActivity> fragmentActivityClass) {
    return SupportFragmentController.of(fragment, fragmentActivityClass)
        .create()
        .start()
        .resume()
        .visible()
        .get();
  }
Sets up the given fragment by attaching it to an activity, calling its onCreate() through
onResume() lifecycle methods, and then making it visible. Note that the fragment will be added
to the view with ID 1.