/// <summary>
        /// Overrode method from System.Object.
        /// </summary>
        /// <param name="obj">The object to be compared.</param>
        /// <returns>True if obj has same data with this instance. False if not.</returns>
        public override bool Equals(object obj)
        {
            // If parameter is null or cannot be cast to Asn1CompositionOfDifferentTypes return false.
            Asn1HeterogeneousComposition p = obj as Asn1HeterogeneousComposition;

            if (p == null)
            {
                return(false);
            }

            // Return true if the fields match.
            var fieldsThis = Fields;
            var fieldsObj  = p.Fields;

            return(fieldsThis.SequenceEqual(fieldsObj));
        }
        /// <summary>
        /// Overrode method from System.Object.
        /// </summary>
        /// <param name="obj">The object to be compared.</param>
        /// <returns>True if obj has same data with this instance. False if not.</returns>
        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Asn1CompositionOfDifferentTypes return false.
            Asn1HeterogeneousComposition p = obj as Asn1HeterogeneousComposition;

            if ((System.Object)p == null)
            {
                return(false);
            }

            // Return true if the fields match.
            Asn1Object[] fieldsThis = Fields;
            Asn1Object[] fieldsObj  = p.Fields;
            return(Enumerable.SequenceEqual <Asn1Object>(fieldsThis, fieldsObj));
        }