code: public <T> InjectorConfiguration withShared(
          T instance
      ) {
          //noinspection unchecked
          return new InjectorConfiguration(
              scopes, definedClasses,
              factories,
              factoryClasses,
              sharedClasses,
              sharedInstances.withPut(instance.getClass(), instance),
              aliases,
              collectedAliases, namedParameterValues
          );
      }
docs: Mark a class instance as shared. The type of the class will be marked as injectable and in all cases this
  class instance will be passed when requested. This holds true even with multiple injectors as long as they
  are created from the same configuration.
  
  @param instance class instance to share.
  
  @return a modified copy of this injection configuration.