BaseGuidancePresenter { public Integer getTimeToArrival() { final RouteTta routeTta = mNavigationManager.getTta(Route.TrafficPenaltyMode.OPTIMAL, false); if (routeTta != null) { return routeTta.getDuration(); } return null; } protected  BaseGuidancePresenter(@NonNull NavigationManager navigationManager, Route route); void resume(); void pause(); Maneuver getNextManeuver(); Maneuver getAfterNextManeuver(); long getNextManeuverDistance(); Route getRoute(); void setRoute(Route route); @Nullable Date getEta(); long getDestinationDistance(); Integer getTimeToArrival();  }
@Test public void testGetTimeToArrival() { RouteTta mockRouteTta = mock(RouteTta.class); when(mNavigationManager.getTta(Route.TrafficPenaltyMode.OPTIMAL, false)).thenReturn(null); assertNull(mBaseGuidancePresenter.getTimeToArrival()); when(mNavigationManager.getTta(Route.TrafficPenaltyMode.OPTIMAL, false)).thenReturn(mockRouteTta); mBaseGuidancePresenter.getTimeToArrival(); verify(mockRouteTta).getDuration(); }