@Config(sdk = Build.VERSION_CODES.JELLY_BEAN_MR2)
@Test public void testFinishCallerDelayedForDestroyedCaller() {

	// Arrange:
	final Activity mockActivity = mock(TestActivity.class);
	final Window mockWindow = mock(Window.class);
	final View decorView = new FrameLayout(context) {
		@Override public boolean postDelayed(@NonNull final Runnable action, final long delayMillis) {
			waitFor(delayMillis);
			action.run();
			return true;
		}
	};
	when(mockWindow.getDecorView()).thenReturn(decorView);
	when(mockActivity.getWindow()).thenReturn(mockWindow);
	when(mockActivity.isDestroyed()).thenReturn(true);
	final BaseNavigationalTransition navTransition = new TestTransition();
	// Act:
	navTransition.finishCallerDelayed(mockActivity, 100);
	// Assert:
	verify(mockActivity).getWindow();
	verify(mockWindow).getDecorView();
	verifyNoMoreInteractions(mockWindow);
	verify(mockActivity).isDestroyed();
	verifyNoMoreInteractions(mockActivity);
}