navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
private static NavDestination findStartDestination(@NonNull NavGraph graph) {
        NavDestination startDestination = graph;
        while (startDestination instanceof NavGraph) {
            NavGraph parent = (NavGraph) startDestination;
            startDestination = parent.findNode(parent.getStartDestination());
        }
        return startDestination;
    }
/**
     * Finds the actual start destination of the graph, handling cases where the graph's starting
     * destination is itself a NavGraph.
     */
Finds the actual start destination of the graph, handling cases where the graph's starting
destination is itself a NavGraph.
Finds the actual start destination of the graph handling cases where the graph ' s starting destination is itself a NavGraph .
private static NavDestination findStartDestination(@NonNull NavGraph graph) {
        NavDestination startDestination = graph;
        while (startDestination instanceof NavGraph) {
            NavGraph parent = (NavGraph) startDestination;
            startDestination = parent.findNode(parent.getStartDestination());
        }
        return startDestination;
    }
private static NavDestination findStartDestination ( @ NonNull NavGraph graph ) { NavDestination startDestination = graph ; while ( startDestination instanceof NavGraph ) { NavGraph parent = ( NavGraph ) startDestination ; startDestination = parent . findNode ( parent . getStartDestination ( ) ) ; } return startDestination ; }
Finds the actual start destination of the graph, handling cases where the graph's starting
 destination is itself a NavGraph.
Finds the actual start destination of the graph handling cases where the graph ' s starting destination is itself a NavGraph .