public function testNamedConstructor()
{
$reference = 'user0';
$instance = StdClassFactory::create(['original' => true]);
$originalInstance = clone $instance;
$object = new SimpleObject($reference, $instance);
$newInstance = StdClassFactory::create(['original' => false]);
$originalNewInstance = clone $newInstance;
$newObject = $object->withInstance($newInstance);
$this->assertEquals(new SimpleObject($reference, $originalInstance), $object);
$this->assertEquals(new SimpleObject($reference, $originalNewInstance), $newObject);
}