public static void Main() { Environment.ExitCode=1; Console.WriteLine("Forcing JIT of overflow path...."); try { throw new System.OverflowException(); }catch(Exception e) { Console.WriteLine("Exception caught in FindLargestInLeftSubTree(): "+e); } Console.WriteLine("Now, on with the test!"); Console.WriteLine("Constructing Red-Black Tree with 10000 nodes"); Tree rbtree; GC.Collect(); try { rbtree = new Tree(10000); rbtree.BuildTree(); } catch(Exception e) { Console.WriteLine("Caught: {0}",e); Environment.ExitCode=1; return; } rbtree = null; GC.Collect(); Console.WriteLine("Done"); Console.WriteLine("Test Passed"); Environment.ExitCode=0; }