navigation/common/src/main/java/androidx/navigation/NavGraph.java
public void remove(@NonNull NavDestination node) {
        int index = mNodes.indexOfKey(node.getId());
        if (index >= 0) {
            mNodes.valueAt(index).setParent(null);
            mNodes.removeAt(index);
        }
    }
/**
     * Remove a given destination from this NavGraph
     *
     * @param node the destination to remove.
     */
Remove a given destination from this NavGraph
@param node the destination to remove.
Remove a given destination from this NavGraph @param node the destination to remove .
public void remove(@NonNull NavDestination node) {
        int index = mNodes.indexOfKey(node.getId());
        if (index >= 0) {
            mNodes.valueAt(index).setParent(null);
            mNodes.removeAt(index);
        }
    }
public void remove ( @ NonNull NavDestination node ) { int index = mNodes . indexOfKey ( node . getId ( ) ) ; if ( index >= 0 ) { mNodes . valueAt ( index ) . setParent ( null ) ; mNodes . removeAt ( index ) ; } }
Remove a given destination from this NavGraph
 @param node the destination to remove.
Remove a given destination from this NavGraph @param node the destination to remove .