FragmentUtils { @SuppressLint("NewApi") @Nullable public static Transition inflateTransition(@NonNull final Context context, @TransitionRes final int resource) { return FragmentPolicies.TRANSITIONS_SUPPORTED && context.getResources() != null ? TransitionInflater.from(context).inflateTransition(resource) : null; } private  FragmentUtils(); static boolean willBeCustomAnimationsPlayed(@NonNull final Context context); static boolean isPowerSaveModeActive(@NonNull final Context context); @SuppressWarnings("deprecation") static boolean areAnimationsEnabled(@NonNull final Context context); @SuppressLint("NewApi") @Nullable static Transition inflateTransition(@NonNull final Context context, @TransitionRes final int resource); @SuppressLint("NewApi") @Nullable static TransitionManager inflateTransitionManager(
			@NonNull final Context context,
			@TransitionRes final int resource,
			@NonNull final ViewGroup sceneRoot
	); @Nullable static Drawable getVectorDrawable(
			@NonNull final Resources resources,
			@DrawableRes final int resId,
			@Nullable final Resources.Theme theme
	); @SuppressWarnings({"NewApi", "deprecation"}) @Nullable static Drawable getDrawable(
			@NonNull final Resources resources,
			@DrawableRes final int resId,
			@Nullable final Resources.Theme theme
	);  }
@Config(sdk = Build.VERSION_CODES.LOLLIPOP) @Test public void testInflateTransitionOnLollipopApiLevel() { final Transition transition = FragmentUtils.inflateTransition(context, android.R.transition.fade); assertThat(transition, is(notNullValue())); assertThat(transition, instanceOf(Fade.class)); }
@Config(sdk = Build.VERSION_CODES.JELLY_BEAN) @Test public void testInflateTransitionOnJellyBeanApiLevel() { assertThat(FragmentUtils.inflateTransition(context, android.R.anim.fade_in), is(nullValue())); }
@Config(sdk = Build.VERSION_CODES.LOLLIPOP) @Test public void testInflateTransitionInContextWithoutResources() { final Context mockContext = mock(Context.class); when(mockContext.getResources()).thenReturn(null); assertThat(FragmentUtils.inflateTransition(mockContext, android.R.anim.fade_in), is(nullValue())); }