@Test
public void testCacheViewModelOnConfigurationChange() {

    activityDelegate.viewModel = viewModel;
    when(activity.isChangingConfigurations()).thenReturn(true);
    activityDelegate.onRetainCustomNonConfigurationInstance();
    assertSame(viewModel, activityDelegate.onRetainCustomNonConfigurationInstance());
}