public static A Create(
			ImmutableObjectGraph.Optional<System.Int32> field1 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                field1: Optional.For(field1.GetValueOrDefault(DefaultInstance.Field1)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        public static Fruit Create(
			ImmutableObjectGraph.Optional<System.String> color = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.Int32> skinThickness = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                color: Optional.For(color.GetValueOrDefault(DefaultInstance.Color)),
                skinThickness: Optional.For(skinThickness.GetValueOrDefault(DefaultInstance.SkinThickness)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        public static ReqAndHierL1 Create(
			System.String l1Field2,
			ImmutableObjectGraph.Optional<System.String> l1Field1 = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                l1Field1: Optional.For(l1Field1.GetValueOrDefault(DefaultInstance.L1Field1)),
                l1Field2: Optional.For(l1Field2),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        public static Contact Create(
			ImmutableObjectGraph.Optional<System.String> name = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> email = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                name: Optional.For(name.GetValueOrDefault(DefaultInstance.Name)),
                email: Optional.For(email.GetValueOrDefault(DefaultInstance.Email)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private ConcreteOf2Abstracts WithFactory(
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (abstract1Field1.IsDefined && abstract1Field1.Value != this.Abstract1Field1) ||
                (abstract1Field2.IsDefined && abstract1Field2.Value != this.Abstract1Field2) ||
                (abstract2Field1.IsDefined && abstract2Field1.Value != this.Abstract2Field1) ||
                (abstract2Field2.IsDefined && abstract2Field2.Value != this.Abstract2Field2) ||
                (concreteField1.IsDefined && concreteField1.Value != this.ConcreteField1) ||
                (concreteField2.IsDefined && concreteField2.Value != this.ConcreteField2)) {
                return new ConcreteOf2Abstracts(
                    identity: identity.GetValueOrDefault(this.Identity),
                    abstract1Field1: abstract1Field1.GetValueOrDefault(this.Abstract1Field1),
                    abstract1Field2: abstract1Field2.GetValueOrDefault(this.Abstract1Field2),
                    abstract2Field1: abstract2Field1.GetValueOrDefault(this.Abstract2Field1),
                    abstract2Field2: abstract2Field2.GetValueOrDefault(this.Abstract2Field2),
                    concreteField1: concreteField1.GetValueOrDefault(this.ConcreteField1),
                    concreteField2: concreteField2.GetValueOrDefault(this.ConcreteField2));
            } else {
                return this;
            }
        }
        public override C2 ToC2(
				ImmutableObjectGraph.Optional<System.Int32> field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> field3 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            return base.ToC2(
                    field2: Optional.For(field2.GetValueOrDefault(this.Field2)),
                    field3: field3);
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual ReqAndHierL2 WithCore(
			ImmutableObjectGraph.Optional<System.String> l1Field1 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l1Field2 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l2Field1 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l2Field2 = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                l1Field1: Optional.For(l1Field1.GetValueOrDefault(this.L1Field1)),
                l1Field2: Optional.For(l1Field2.GetValueOrDefault(this.L1Field2)),
                l2Field1: Optional.For(l2Field1.GetValueOrDefault(this.L2Field1)),
                l2Field2: Optional.For(l2Field2.GetValueOrDefault(this.L2Field2)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual NonEmptyBase WithCore(
			ImmutableObjectGraph.Optional<System.Boolean> oneField = default(ImmutableObjectGraph.Optional<System.Boolean>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                oneField: Optional.For(oneField.GetValueOrDefault(this.OneField)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        public static NonEmptyBase Create(
			ImmutableObjectGraph.Optional<System.Boolean> oneField = default(ImmutableObjectGraph.Optional<System.Boolean>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                oneField: Optional.For(oneField.GetValueOrDefault(DefaultInstance.OneField)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private Fruit WithFactory(
			ImmutableObjectGraph.Optional<System.String> color = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.Int32> skinThickness = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (color.IsDefined && color.Value != this.Color) ||
                (skinThickness.IsDefined && skinThickness.Value != this.SkinThickness)) {
                return new Fruit(
                    identity: identity.GetValueOrDefault(this.Identity),
                    color: color.GetValueOrDefault(this.Color),
                    skinThickness: skinThickness.GetValueOrDefault(this.SkinThickness));
            } else {
                return this;
            }
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private C2 WithFactory(
			ImmutableObjectGraph.Optional<System.Int32> field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> field3 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (field1.IsDefined && field1.Value != this.Field1) ||
                (field2.IsDefined && field2.Value != this.Field2) ||
                (field3.IsDefined && field3.Value != this.Field3)) {
                return new C2(
                    identity: identity.GetValueOrDefault(this.Identity),
                    field1: field1.GetValueOrDefault(this.Field1),
                    field2: field2.GetValueOrDefault(this.Field2),
                    field3: field3.GetValueOrDefault(this.Field3));
            } else {
                return this;
            }
        }
        internal static C2 CreateWithIdentity(
				ImmutableObjectGraph.Optional<System.Int32> field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> field3 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (!identity.IsDefined) {
                identity = NewIdentity();
            }

            return DefaultInstance.WithFactory(
                    field1: Optional.For(field1.GetValueOrDefault(DefaultInstance.Field1)),
                    field2: Optional.For(field2.GetValueOrDefault(DefaultInstance.Field2)),
                    field3: Optional.For(field3.GetValueOrDefault(DefaultInstance.Field3)),
                    identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual ConcreteOf2Abstracts WithCore(
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField2 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                abstract1Field1: Optional.For(abstract1Field1.GetValueOrDefault(this.Abstract1Field1)),
                abstract1Field2: Optional.For(abstract1Field2.GetValueOrDefault(this.Abstract1Field2)),
                abstract2Field1: Optional.For(abstract2Field1.GetValueOrDefault(this.Abstract2Field1)),
                abstract2Field2: Optional.For(abstract2Field2.GetValueOrDefault(this.Abstract2Field2)),
                concreteField1: Optional.For(concreteField1.GetValueOrDefault(this.ConcreteField1)),
                concreteField2: Optional.For(concreteField2.GetValueOrDefault(this.ConcreteField2)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        internal static ConcreteOf2Abstracts CreateWithIdentity(
				ImmutableObjectGraph.Optional<System.Int32> abstract1Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> abstract1Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> abstract2Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> abstract2Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> concreteField1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> concreteField2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (!identity.IsDefined) {
                identity = NewIdentity();
            }

            return DefaultInstance.WithFactory(
                    abstract1Field1: Optional.For(abstract1Field1.GetValueOrDefault(DefaultInstance.Abstract1Field1)),
                    abstract1Field2: Optional.For(abstract1Field2.GetValueOrDefault(DefaultInstance.Abstract1Field2)),
                    abstract2Field1: Optional.For(abstract2Field1.GetValueOrDefault(DefaultInstance.Abstract2Field1)),
                    abstract2Field2: Optional.For(abstract2Field2.GetValueOrDefault(DefaultInstance.Abstract2Field2)),
                    concreteField1: Optional.For(concreteField1.GetValueOrDefault(DefaultInstance.ConcreteField1)),
                    concreteField2: Optional.For(concreteField2.GetValueOrDefault(DefaultInstance.ConcreteField2)),
                    identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        public static ConcreteOf2Abstracts Create(
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract1Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> abstract2Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> concreteField2 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                abstract1Field1: Optional.For(abstract1Field1.GetValueOrDefault(DefaultInstance.Abstract1Field1)),
                abstract1Field2: Optional.For(abstract1Field2.GetValueOrDefault(DefaultInstance.Abstract1Field2)),
                abstract2Field1: Optional.For(abstract2Field1.GetValueOrDefault(DefaultInstance.Abstract2Field1)),
                abstract2Field2: Optional.For(abstract2Field2.GetValueOrDefault(DefaultInstance.Abstract2Field2)),
                concreteField1: Optional.For(concreteField1.GetValueOrDefault(DefaultInstance.ConcreteField1)),
                concreteField2: Optional.For(concreteField2.GetValueOrDefault(DefaultInstance.ConcreteField2)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        public override ConcreteOf2Abstracts ToConcreteOf2Abstracts(
				ImmutableObjectGraph.Optional<System.Int32> abstract2Field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> abstract2Field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> concreteField1 = default(ImmutableObjectGraph.Optional<System.Int32>),
				ImmutableObjectGraph.Optional<System.Int32> concreteField2 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            return base.ToConcreteOf2Abstracts(
                    abstract2Field1: Optional.For(abstract2Field1.GetValueOrDefault(this.Abstract2Field1)),
                    abstract2Field2: Optional.For(abstract2Field2.GetValueOrDefault(this.Abstract2Field2)),
                    concreteField1: concreteField1,
                    concreteField2: concreteField2);
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private ReqAndHierL2 WithFactory(
			ImmutableObjectGraph.Optional<System.String> l1Field1 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l1Field2 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l2Field1 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> l2Field2 = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (l1Field1.IsDefined && l1Field1.Value != this.L1Field1) ||
                (l1Field2.IsDefined && l1Field2.Value != this.L1Field2) ||
                (l2Field1.IsDefined && l2Field1.Value != this.L2Field1) ||
                (l2Field2.IsDefined && l2Field2.Value != this.L2Field2)) {
                return new ReqAndHierL2(
                    identity: identity.GetValueOrDefault(this.Identity),
                    l1Field1: l1Field1.GetValueOrDefault(this.L1Field1),
                    l1Field2: l1Field2.GetValueOrDefault(this.L1Field2),
                    l2Field1: l2Field1.GetValueOrDefault(this.L2Field1),
                    l2Field2: l2Field2.GetValueOrDefault(this.L2Field2));
            } else {
                return this;
            }
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual C2 WithCore(
			ImmutableObjectGraph.Optional<System.Int32> field1 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> field2 = default(ImmutableObjectGraph.Optional<System.Int32>),
			ImmutableObjectGraph.Optional<System.Int32> field3 = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                field1: Optional.For(field1.GetValueOrDefault(this.Field1)),
                field2: Optional.For(field2.GetValueOrDefault(this.Field2)),
                field3: Optional.For(field3.GetValueOrDefault(this.Field3)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual Contact WithCore(
			ImmutableObjectGraph.Optional<System.String> name = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> email = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                name: Optional.For(name.GetValueOrDefault(this.Name)),
                email: Optional.For(email.GetValueOrDefault(this.Email)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual Fruit WithCore(
			ImmutableObjectGraph.Optional<System.String> color = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.Int32> skinThickness = default(ImmutableObjectGraph.Optional<System.Int32>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                color: Optional.For(color.GetValueOrDefault(this.Color)),
                skinThickness: Optional.For(skinThickness.GetValueOrDefault(this.SkinThickness)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private Contact WithFactory(
			ImmutableObjectGraph.Optional<System.String> name = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> email = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (name.IsDefined && name.Value != this.Name) ||
                (email.IsDefined && email.Value != this.Email)) {
                return new Contact(
                    identity: identity.GetValueOrDefault(this.Identity),
                    name: name.GetValueOrDefault(this.Name),
                    email: email.GetValueOrDefault(this.Email));
            } else {
                return this;
            }
        }
        public static Message Create(
			ImmutableObjectGraph.Optional<Contact> author = default(ImmutableObjectGraph.Optional<Contact>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> to = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> cc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> bcc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.String> subject = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> body = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = Optional.For(NewIdentity());
            return DefaultInstance.WithFactory(
                author: Optional.For(author.GetValueOrDefault(DefaultInstance.Author)),
                to: Optional.For(to.GetValueOrDefault(DefaultInstance.To)),
                cc: Optional.For(cc.GetValueOrDefault(DefaultInstance.Cc)),
                bcc: Optional.For(bcc.GetValueOrDefault(DefaultInstance.Bcc)),
                subject: Optional.For(subject.GetValueOrDefault(DefaultInstance.Subject)),
                body: Optional.For(body.GetValueOrDefault(DefaultInstance.Body)),
                identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual Message WithCore(
			ImmutableObjectGraph.Optional<Contact> author = default(ImmutableObjectGraph.Optional<Contact>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> to = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> cc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> bcc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.String> subject = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> body = default(ImmutableObjectGraph.Optional<System.String>))
        {
            var identity = default(ImmutableObjectGraph.Optional<System.UInt32>);
            return this.WithFactory(
                author: Optional.For(author.GetValueOrDefault(this.Author)),
                to: Optional.For(to.GetValueOrDefault(this.To)),
                cc: Optional.For(cc.GetValueOrDefault(this.Cc)),
                bcc: Optional.For(bcc.GetValueOrDefault(this.Bcc)),
                subject: Optional.For(subject.GetValueOrDefault(this.Subject)),
                body: Optional.For(body.GetValueOrDefault(this.Body)),
                identity: Optional.For(identity.GetValueOrDefault(this.Identity)));
        }
        internal static NonEmptyBase CreateWithIdentity(
				ImmutableObjectGraph.Optional<System.Boolean> oneField = default(ImmutableObjectGraph.Optional<System.Boolean>),
				ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (!identity.IsDefined) {
                identity = NewIdentity();
            }

            return DefaultInstance.WithFactory(
                    oneField: Optional.For(oneField.GetValueOrDefault(DefaultInstance.OneField)),
                    identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private Message WithFactory(
			ImmutableObjectGraph.Optional<Contact> author = default(ImmutableObjectGraph.Optional<Contact>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> to = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> cc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>> bcc = default(ImmutableObjectGraph.Optional<System.Collections.Immutable.ImmutableList<Contact>>),
			ImmutableObjectGraph.Optional<System.String> subject = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.String> body = default(ImmutableObjectGraph.Optional<System.String>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (author.IsDefined && author.Value != this.Author) ||
                (to.IsDefined && to.Value != this.To) ||
                (cc.IsDefined && cc.Value != this.Cc) ||
                (bcc.IsDefined && bcc.Value != this.Bcc) ||
                (subject.IsDefined && subject.Value != this.Subject) ||
                (body.IsDefined && body.Value != this.Body)) {
                return new Message(
                    identity: identity.GetValueOrDefault(this.Identity),
                    author: author.GetValueOrDefault(this.Author),
                    to: to.GetValueOrDefault(this.To),
                    cc: cc.GetValueOrDefault(this.Cc),
                    bcc: bcc.GetValueOrDefault(this.Bcc),
                    subject: subject.GetValueOrDefault(this.Subject),
                    body: body.GetValueOrDefault(this.Body));
            } else {
                return this;
            }
        }
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        private NonEmptyBase WithFactory(
			ImmutableObjectGraph.Optional<System.Boolean> oneField = default(ImmutableObjectGraph.Optional<System.Boolean>),
			ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (
                (identity.IsDefined && identity.Value != this.Identity) ||
                (oneField.IsDefined && oneField.Value != this.OneField)) {
                return new NonEmptyBase(
                    identity: identity.GetValueOrDefault(this.Identity),
                    oneField: oneField.GetValueOrDefault(this.OneField));
            } else {
                return this;
            }
        }
        internal static ReqAndHierL2 CreateWithIdentity(
				System.String l1Field2,
				System.String l2Field2,
				ImmutableObjectGraph.Optional<System.String> l1Field1 = default(ImmutableObjectGraph.Optional<System.String>),
				ImmutableObjectGraph.Optional<System.String> l2Field1 = default(ImmutableObjectGraph.Optional<System.String>),
				ImmutableObjectGraph.Optional<System.UInt32> identity = default(ImmutableObjectGraph.Optional<System.UInt32>))
        {
            if (!identity.IsDefined) {
                identity = NewIdentity();
            }

            return DefaultInstance.WithFactory(
                    l1Field1: Optional.For(l1Field1.GetValueOrDefault(DefaultInstance.L1Field1)),
                    l1Field2: Optional.For(l1Field2),
                    l2Field1: Optional.For(l2Field1.GetValueOrDefault(DefaultInstance.L2Field1)),
                    l2Field2: Optional.For(l2Field2),
                    identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity)));
        }