How do I inject services in class that implements an interface? How do I inject services in a class that implements an interface.

class RoleNegotiator implements ThemeNegotiatorInterface {

  public static function create(ContainerInterface $interface) {
    return new static(
      $interface-&gt;get('router.admin_context')
    );
  }
  public function __construct(RouteMatchInterface $route) {
    $this-&gt;route = $route;
  }
}


The above code throws an error.
You define the necessary services as arguments of the service you implement. 

Since you are showing a class that implements ThemeNegotiatorInterface, see the theme.negotiator.default service and the class implementing it, Drupal\Core\Theme\DefaultNegotiator. 

Service definition

  theme.negotiator.default:
    class: Drupal\Core\Theme\DefaultNegotiator
    arguments: ['@config.factory']
    tags:
      - { name: theme_negotiator, priority: -100 }


Class constructor

public function __construct(ConfigFactoryInterface $config_factory) {
  $this-&gt;configFactory = $config_factory;
}


There isn't any static create() method as in your code.