NavigatingActivityDelegate extends ActivityDelegate<S, U> { @Override public void onDestroy() { if (viewModel != null) { viewModel.setNavigator(null); } super.onDestroy(); } NavigatingActivityDelegate(@NonNull ActivityDelegateCallback<S, U> callback,
                                      @NonNull NavigatingDelegateCallback<T> navigatingCallback,
                                      @NonNull Activity delegatedActivity); @Override @CallSuper void onCreate(); @Override void onDestroy();  }
@Test public void testRemoveNavigatorOnDestroy() { ReflectionUtils.setParentField(delegate, "viewModel", viewModel); delegate.onDestroy(); verify(viewModel).setNavigator(null); }
@Test public void testNoNullPointerOnNavigatorDeleteIfViewModelRemoved() { assertNull(ReflectionUtils.getParentField(delegate, "viewModel")); delegate.onDestroy(); }