protected CollectionIsolator(TCollection instance = null) { using (ShimRuntime.AcquireProtectingThreadContext()) { if (instance == null) { fake = (TCollectionFake)((object)Activator.CreateInstance(typeof(TCollectionFake))); } else { fake = (TCollectionFake)((object)Activator.CreateInstance(typeof(TCollectionFake), new object[] { instance })); } InstancedPool.RegisterInstanced(this); } }