System Services are not just for the system
Mike Nakhimovich
999

I’ve taken this a little bit further and added a static convenience method in my Injector utility class to do the component casting as well:

public static <C> C component(Class<C> componentType, Context context) {
return componentType.cast(context.getSystemService(“injector”));
}

Requires that you pass in the correct Context of course for the component that you are expecting.