src/main/java/js/container/ThreadScopeFactory.java
@Override
	public void persistInstance(InstanceKey instanceKey, Object instance) {
		// at this point managed class and instance are guaranteed to be non null

		ThreadLocal<Object> tls = instancesPool.get(instanceKey);
		if (tls == null) {
			throw new BugError("Invalid methods invocation sequence. Ensure getInstance() is invoked before and is executed in the same thread.");
		}
		tls.set(instance);
	}
@Override
	public void persistInstance(InstanceKey instanceKey, Object instance) {
		// at this point managed class and instance are guaranteed to be non null

		ThreadLocal<Object> tls = instancesPool.get(instanceKey);
		if (tls == null) {
			throw new BugError("Invalid methods invocation sequence. Ensure getInstance() is invoked before and is executed in the same thread.");
		}
		tls.set(instance);
	}
@ Override public void persistInstance ( InstanceKey instanceKey , Object instance ) { // at this point managed class and instance are guaranteed to be non null
 ThreadLocal < Object > tls = instancesPool . get ( instanceKey ) ; if ( tls == null ) { throw new BugError ( "Invalid methods invocation sequence. Ensure getInstance() is invoked before and is executed in the same thread." ) ; } tls . set ( instance ) ; }
Persist instance on current thread bound to given managed class. This method simply uses provided instance key argument
to add instance to {@link #instancesPool}. Both arguments should to be not null.

@param instanceKey managed instance key,
@param instance managed instance.
Persist instance on current thread bound to given managed class . This method simply uses provided instance key argument to add instance to { @link #instancesPool } . Both arguments should to be not null .