public void EmptyWithRegeneratesType()
        {
            var empty = EmptyDerivedFromAbstract.Create();
            AbstractNonEmpty emptyAsBase = empty;

            EmptyDerivedFromAbstract newInstance       = empty.With(oneField: true);
            AbstractNonEmpty         newInstanceAsBase = emptyAsBase.With(oneField: true);

            Assert.Equal(empty.Identity, newInstance.Identity);
            Assert.Equal(empty.Identity, newInstanceAsBase.Identity);
        }
 public AbstractNonEmpty ToImmutable()
 {
     return this.immutable = this.immutable.With(
         ImmutableObjectGraph.Optional.For(this.OneField));
 }
            internal Builder(AbstractNonEmpty immutable)
            {
                this.immutable = immutable;

                this.oneField = immutable.OneField;
            }
 public AbstractNonEmpty ToImmutable()
 {
     return(this.immutable = this.immutable.With(
                ImmutableObjectGraph.Optional.For(this.OneField)));
 }
            internal Builder(AbstractNonEmpty immutable)
            {
                this.immutable = immutable;

                this.oneField = immutable.OneField;
            }