public void RequiredFieldsAppearInMultipleRelatedTypes()
        {
            ReqAndHierL2 value = ReqAndHierL2.Create("l1f2Value", "l2f2Value");

            Assert.Equal("l1f2Value", value.L1Field2);
            Assert.Equal("l2f2Value", value.L2Field2);
            Assert.Null(value.L1Field1);
            Assert.Null(value.L2Field1);
        }
        public virtual ReqAndHierL2 ToReqAndHierL2(
            System.String l2Field2,
            ImmutableObjectGraph.Optional <System.String> l2Field1 = default(ImmutableObjectGraph.Optional <System.String>))
        {
            ReqAndHierL2 that = this as ReqAndHierL2;

            if (that != null && this.GetType().IsEquivalentTo(typeof(ReqAndHierL2)))
            {
                if ((!l2Field1.IsDefined || l2Field1.Value == that.L2Field1) &&
                    (l2Field2 == that.L2Field2))
                {
                    return(that);
                }
            }

            return(ReqAndHierL2.Create(
                       l1Field1: this.L1Field1,
                       l1Field2: this.L1Field2,
                       l2Field1: l2Field1,
                       l2Field2: l2Field2));
        }