How do you inject dependencies in your classes from external packages? My project has external PHP packages pulled in via Composer.

I would like to inject one of the classes in that package as a dependency, instead of do new Class(); inside my Controller methods.

The documentation says you can define a service like the following:

services:
  mymodule.example_service:
    class: Drupal\path\to\Class


What do you do when you want to use an external PHP package not native to Drupal?
You should be able to use the fully qualified namespace for the injection:

services:
  mymodule.example_service:
    class: path\to\Class