@Test public void addAll() { NavDestination destination = createFirstDestination(); NavGraph other = createGraphWithDestination(destination); NavGraph graph = mNavGraphNavigator.createDestination(); graph.addAll(other); assertThat(destination.getParent(), is(graph)); assertThat(graph.findNode(FIRST_DESTINATION_ID), is(destination)); assertThat(other.findNode(FIRST_DESTINATION_ID), nullValue()); }
public void addAll(@NonNull NavGraph other) { Iterator<NavDestination> iterator = other.iterator(); while (iterator.hasNext()) { NavDestination destination = iterator.next(); iterator.remove(); addDestination(destination); } }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void addAll(@NonNull NavGraph other) { Iterator<NavDestination> iterator = other.iterator(); while (iterator.hasNext()) { NavDestination destination = iterator.next(); iterator.remove(); addDestination(destination); } } }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void addAll(@NonNull NavGraph other) { Iterator<NavDestination> iterator = other.iterator(); while (iterator.hasNext()) { NavDestination destination = iterator.next(); iterator.remove(); addDestination(destination); } } NavGraph(@NonNull NavigatorProvider navigatorProvider);  NavGraph(@NonNull Navigator<? extends NavGraph> navGraphNavigator); }
NavGraph extends NavDestination implements Iterable<NavDestination> { public void addAll(@NonNull NavGraph other) { Iterator<NavDestination> iterator = other.iterator(); while (iterator.hasNext()) { NavDestination destination = iterator.next(); iterator.remove(); addDestination(destination); } } 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 addAll(@NonNull NavGraph other) { Iterator<NavDestination> iterator = other.iterator(); while (iterator.hasNext()) { NavDestination destination = iterator.next(); iterator.remove(); addDestination(destination); } } 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);  }