### Question:
NavigationViewEventDispatcher { boolean allowRerouteFrom(Point point) { return routeListener == null || routeListener.allowRerouteFrom(point); }    }### Answer:
@Test public void onRouteListenerNotSet_allowRerouteFromListenerIsNotCalled_andReturnsTrue() throws Exception { NavigationViewEventDispatcher eventDispatcher = new NavigationViewEventDispatcher(); RouteListener routeListener = mock(RouteListener.class); Point point = mock(Point.class); boolean shouldAllowReroute = eventDispatcher.allowRerouteFrom(point); verify(routeListener, times(0)).allowRerouteFrom(point); assertTrue(shouldAllowReroute); }
@Test public void onRouteListenerNotSet_allowRerouteListenerIsNotCalled() throws Exception { NavigationViewEventDispatcher eventDispatcher = new NavigationViewEventDispatcher(); RouteListener routeListener = mock(RouteListener.class); Point point = mock(Point.class); eventDispatcher.allowRerouteFrom(point); verify(routeListener, times(0)).allowRerouteFrom(point); }