The factory should check the type of `$serviceLocator` here or throw an exception otherwise