public AbstractSemanticObject[] BuildBs()
 {
     AbstractSemanticObject[] result = new AbstractSemanticObject[5];
     SemanticObjectA a = new SemanticObjectA();
     SemanticObjectC lastC = null;
     for (int i = 0; i < 5; i++)
     {
         SemanticObjectB b = new SemanticObjectB
         {
             IntProperty = i,
             StringProperty = s_SomeStrings[i]
         };
         for (int j = 0; j < 10; j++)
         {
             SemanticObjectC c = new SemanticObjectC
             {
                 B = b,
                 A = a
             };
             lastC = c;
         }
         b.A = a;
         result[i] = b;
     }
     // this creates a loop, as it is downstream, but not a collection
     a.C = lastC;
     return result;
 }
        internal void AddB(SemanticObjectB b)
        {
            Contract.Requires(b != null);
            Contract.Requires(b.A == this);
            Contract.Ensures(Bs.Contains(b));

            if (!m_Bs.Contains(b))
            {
                m_Bs.Add(b);
            }
        }
 public void CreateAbstractSemanticObject()
 {
     AbstractSemanticObject result = new SemanticObjectB();
     result = new SemanticObjectA();
     result = new SemanticObjectC();
 }
        internal void RemoveB(SemanticObjectB b)
        {
            Contract.Ensures(! Bs.Contains(b));

            m_Bs.Remove(b);
        }