shadows/supportv4/src/main/java/org/robolectric/shadows/support/v4/SupportFragmentController.java
public static <F extends Fragment> F setupFragment(F fragment) {
    return SupportFragmentController.of(fragment).create().start().resume().visible().get();
  }
public static <F extends Fragment> F setupFragment(F fragment) {
    return SupportFragmentController.of(fragment).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.