### Question:
NavController { public final void navigate(@IdRes int resId) { navigate(resId, null); } NavController(@NonNull Context context); @NonNull NavigatorProvider getNavigatorProvider(); void addOnNavigatedListener(@NonNull OnNavigatedListener listener); void removeOnNavigatedListener(@NonNull OnNavigatedListener listener); boolean popBackStack(); boolean popBackStack(@IdRes int destinationId, boolean inclusive); boolean navigateUp(); void setMetadataGraph(); @NonNull NavInflater getNavInflater(); void setGraph(@NavigationRes int graphResId); void setGraph(@NonNull NavGraph graph); boolean onHandleDeepLink(@Nullable Intent intent); NavGraph getGraph(); NavDestination getCurrentDestination(); final void navigate(@IdRes int resId); final void navigate(@IdRes int resId, @Nullable Bundle args); @SuppressWarnings("deprecation") void navigate(@IdRes int resId, @Nullable Bundle args, @Nullable NavOptions navOptions); void navigate(@NonNull NavDirections directions); void navigate(@NonNull NavDirections directions, @Nullable NavOptions navOptions); @NonNull NavDeepLinkBuilder createDeepLink(); @Nullable Bundle saveState(); void restoreState(@Nullable Bundle navState); static final String KEY_DEEP_LINK_INTENT; }### Answer:
@Test public void testNavigate() { NavController navController = createNavController(); navController.setGraph(R.navigation.nav_simple); TestNavigator navigator = navController.getNavigatorProvider() .getNavigator(TestNavigator.class); assertThat(navController.getCurrentDestination().getId(), is(R.id.start_test)); assertThat(navigator.mBackStack.size(), is(1)); navController.navigate(R.id.second_test); assertThat(navController.getCurrentDestination().getId(), is(R.id.second_test)); assertThat(navigator.mBackStack.size(), is(2)); }