BaseNavigationalTransition { @SuppressWarnings("unchecked") public T returnTransition(@Nullable final Transition transition) { this.specifiedTransitions |= TRANSITION_RETURN; this.returnTransition = transition; return (T) this; } BaseNavigationalTransition();  BaseNavigationalTransition(@NonNull final Class<? extends Activity> classOfTransitionActivity); @SuppressWarnings("deprecation") @Nullable final Class<? extends Activity> getActivityClass(); @SuppressWarnings("unchecked") T intentExtras(@Nullable final Bundle extras); @NonNull Bundle intentExtras(); @SuppressWarnings("unchecked") T requestCode(@IntRange(from = RC_NONE) final int requestCode); @IntRange(from = RC_NONE) int requestCode(); @SuppressWarnings("unchecked") T enterTransition(@Nullable final Transition transition); @Nullable Transition enterTransition(); @SuppressWarnings("unchecked") T reenterTransition(@Nullable final Transition transition); @Nullable Transition reenterTransition(); @SuppressWarnings("unchecked") T returnTransition(@Nullable final Transition transition); @Nullable Transition returnTransition(); @SuppressWarnings("unchecked") T exitTransition(@Nullable final Transition transition); @Nullable Transition exitTransition(); @SuppressWarnings("unchecked") T allowEnterTransitionOverlap(final boolean allow); boolean allowEnterTransitionOverlap(); @SuppressWarnings("unchecked") T allowReturnTransitionOverlap(final boolean allow); boolean allowReturnTransitionOverlap(); @SuppressWarnings("unchecked") T sharedElementEnterTransition(@Nullable final Transition transition); @Nullable Transition sharedElementEnterTransition(); @SuppressWarnings("unchecked") T sharedElementReenterTransition(@Nullable final Transition transition); @Nullable Transition sharedElementReenterTransition(); @SuppressWarnings("unchecked") T sharedElementReturnTransition(@Nullable final Transition transition); @Nullable Transition sharedElementReturnTransition(); @SuppressWarnings("unchecked") T sharedElementExitTransition(@Nullable final Transition transition); @Nullable Transition sharedElementExitTransition(); @SuppressWarnings("unchecked") T sharedElementsUseOverlay(final boolean useOverlay); boolean sharedElementsUseOverlay(); @SuppressLint("NewApi") @Nullable Transition inflateTransition(@NonNull final Context context, final int resource); @SuppressLint("NewApi") @Nullable TransitionManager inflateTransitionManager(@NonNull final Context context, final int resource, @NonNull final ViewGroup sceneRoot); @SuppressWarnings("unchecked") @SafeVarargs final T sharedElements(@NonNull final Pair<View, String>... elements); @SuppressWarnings("unchecked") T sharedElement(@NonNull final View element, @NonNull final String elementName); @Nullable List<Pair<View, String>> sharedElements(); @Nullable Pair<View, String> singleSharedElement(); void start(@NonNull final Activity caller); void configureTransitions(@NonNull final Activity activity); void configureIncomingTransitions(@NonNull final Activity activity); void configureOutgoingTransitions(@NonNull final Activity activity); @SuppressLint("NewApi") @SuppressWarnings("unchecked") @Nullable ActivityOptions makeSceneTransitionAnimation(@NonNull final Activity caller); @NonNull Intent createIntent(@NonNull final Activity caller); void finish(@NonNull final Activity caller); static final boolean MATERIAL_SUPPORT; static final int RC_NONE; }
@Config(sdk = Build.VERSION_CODES.LOLLIPOP) @Test public void testReturnTransition() { final Transition transition = new Fade(); assertThat(new TestTransition().returnTransition(transition).returnTransition(), is(transition)); }