### Question:
NavigationViewEventDispatcher { void onNavigationFinished() { if (navigationListener != null) { navigationListener.onNavigationFinished(); } }    }### Answer:
@Test public void onNavigationListenerNotSet_finishedListenerIsNotCalled() throws Exception { NavigationViewEventDispatcher eventDispatcher = new NavigationViewEventDispatcher(); NavigationListener navigationListener = mock(NavigationListener.class); eventDispatcher.onNavigationFinished(); verify(navigationListener, times(0)).onNavigationFinished(); }
@Test public void onNavigationListenerNotSet_finishedListenerIsNotCalled() { NavigationViewEventDispatcher eventDispatcher = new NavigationViewEventDispatcher(); NavigationListener navigationListener = mock(NavigationListener.class); eventDispatcher.onNavigationFinished(); verify(navigationListener, times(0)).onNavigationFinished(); }