@Test public void clear() { NavDestination destination = createFirstDestination(); NavDestination secondDestination = createSecondDestination(); NavGraph graph = createGraphWithDestinations(destination, secondDestination); graph.clear(); assertThat(destination.getParent(), nullValue()); assertThat(graph.findNode(FIRST_DESTINATION_ID), nullValue()); assertThat(secondDestination.getParent(), nullValue()); assertThat(graph.findNode(SECOND_DESTINATION_ID), nullValue()); }
public void clear() { Iterator<NavDestination> iterator = iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void clear() { Iterator<NavDestination> iterator = iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } } }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void clear() { Iterator<NavDestination> iterator = iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } } NavGraph(@NonNull NavigatorProvider navigatorProvider);  NavGraph(@NonNull Navigator<? extends NavGraph> navGraphNavigator); }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void clear() { Iterator<NavDestination> iterator = iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } } NavGraph(@NonNull NavigatorProvider navigatorProvider);  NavGraph(@NonNull Navigator<? extends NavGraph> navGraphNavigator); @Override void onInflate(@NonNull Context context, @NonNull AttributeSet attrs); void addDestination(@NonNull NavDestination node); void addDestinations(@NonNull Collection<NavDestination> nodes); void addDestinations(@NonNull NavDestination... nodes); NavDestination findNode(@IdRes int resid); @NonNull @Override Iterator<NavDestination> iterator(); void addAll(@NonNull NavGraph other); void remove(@NonNull NavDestination node); void clear(); @IdRes int getStartDestination(); void setStartDestination(@IdRes int startDestId); }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void clear() { Iterator<NavDestination> iterator = iterator(); while (iterator.hasNext()) { iterator.next(); iterator.remove(); } } NavGraph(@NonNull NavigatorProvider navigatorProvider);  NavGraph(@NonNull Navigator<? extends NavGraph> navGraphNavigator); @Override void onInflate(@NonNull Context context, @NonNull AttributeSet attrs); void addDestination(@NonNull NavDestination node); void addDestinations(@NonNull Collection<NavDestination> nodes); void addDestinations(@NonNull NavDestination... nodes); NavDestination findNode(@IdRes int resid); @NonNull @Override Iterator<NavDestination> iterator(); void addAll(@NonNull NavGraph other); void remove(@NonNull NavDestination node); void clear(); @IdRes int getStartDestination(); void setStartDestination(@IdRes int startDestId);  }