@Test
public void testDestroyViewModelWhenInBackStack() {

    activityDelegate.viewModel = viewModel;
    when(activity.isChangingConfigurations()).thenReturn(false);
    activityDelegate.onRetainCustomNonConfigurationInstance();
    verify(viewModel).onDestroy();
}