code: public InjectorConfiguration withScopeShared(
          Class scope,
          Class classDefinition
      ) {
          //noinspection unchecked
          return new InjectorConfiguration(
              scopes, definedClasses,
              factories,
              factoryClasses,
              sharedClasses.withModified(scope, (value) -> value.withAdd(classDefinition)),
              sharedInstances,
              aliases,
              collectedAliases, namedParameterValues
          );
      }
docs: Marks a class definition as injectable and shared on a global scope. the first time this class definition will
  be instantiated in an injector, it will be cached for subsequent calls. This comes with a couple of caveats:
  
  1. the first instance of this class created, no matter in what specific context, may be cached.
  2. it is not guaranteed that this class will only be instantiated once. The injection process may take place in
  parallel threads, so instantiation may happen multiple times. However, only a single instance will be
  returned and retained.
  3. if you use multiple dependency injector copies, the shared instances may not be shared between them. To
  ensure singleton-ness, use the withShared method that accepts a pre-instantiated copy.
  
  @param classDefinition the class that should be shared.
  
  @return a modified copy of this injection configuration