how to get list of all route in routeProvider? I have:

class MyRouteProvider extends DefaultHtmlRouteProvider {
    public function getRoutes(EntityTypeInterface $entity_type) {
        $test = parent::getRoutes($entity_type); // TODO: Change the autogenerated stub
        // how do i get list of route that i have in this method?
    }
}


how do i get list of route that i have in getRoutes method?

what i'm trying to do here is: I like to search a particular route (based on $entity type) that created by my_entitiy and modify it.
Not really sure what you are aiming for, but you have it already as the getRoutes() method works with a Symfony RouteCollection collection

class MyRouteProvider extends DefaultHtmlRouteProvider {
  public function getRoutes(EntityTypeInterface $entity_type) {
    /** @var \Symfony\Component\Routing\RouteCollection */
    $collection = parent::getRoutes($entity_type);
    /** @var \Symfony\Component\Routing\Route[] */
    $routes = $collection-&gt;all();

    return $collection;  
  }
}


If sounds like, though, you want to implement a RouteSubscriber to alter the route.  There are a bunch of these in core to use as examples.  And you don't need to get all of the routes, and then search through them.  You can just use the route collection and get the route that you need.  The route subscriber defined by the Node module is probably the simplest example:

class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    // As nodes are the primary type of content, the node listing should be
    // easily available. In order to do that, override admin/content to show
    // a node listing instead of the path's child links.
    $route = $collection-&gt;get('system.admin_content');
    if ($route) {
      $route-&gt;setDefaults([
        '_title' =&gt; 'Content',
        '_entity_list' =&gt; 'node',
      ]);
      $route-&gt;setRequirements([
        '_permission' =&gt; 'access content overview',
      ]);
    }
  }

}


Note that is just does a $collection-&gt;get() to find a particular route, and then modifies it.