@Test @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) public void startActivityTestForPriorJellyBean() { ReflectionHelpers.setStaticField(Build.VERSION.class, SDK_INT, Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1); VersionUtilities.startActivity(activityMock, intentMock, optionsMock); verify(activityMock, times(1)).startActivity(intentMock); verifyNoMoreInteractions(activityMock); }
public static void startActivity(final Activity activity, final Intent intent, final Bundle options) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { activity.startActivity(intent, options); } else { activity.startActivity(intent); } }
VersionUtilities { public static void startActivity(final Activity activity, final Intent intent, final Bundle options) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { activity.startActivity(intent, options); } else { activity.startActivity(intent); } } }
VersionUtilities { public static void startActivity(final Activity activity, final Intent intent, final Bundle options) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { activity.startActivity(intent, options); } else { activity.startActivity(intent); } } private  VersionUtilities(); }
VersionUtilities { public static void startActivity(final Activity activity, final Intent intent, final Bundle options) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { activity.startActivity(intent, options); } else { activity.startActivity(intent); } } private  VersionUtilities(); static void startActivity(final Activity activity, final Intent intent, final Bundle options); }
VersionUtilities { public static void startActivity(final Activity activity, final Intent intent, final Bundle options) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { activity.startActivity(intent, options); } else { activity.startActivity(intent); } } private  VersionUtilities(); static void startActivity(final Activity activity, final Intent intent, final Bundle options);  }