public void sortTest2()
        {
            ArrayList <TestObject> a, b;
            TestObjectComparator   c;
            bool d;

            a = new ArrayList <TestObject>();
            a.add(new TestObject("first", 3));
            a.add(new TestObject("second", 2));
            a.add(new TestObject("third", 8));
            a.add(new TestObject("fourth", 7));
            a.add(new TestObject("fifth", 6));
            a.add(new TestObject("sixth", 3));
            a.add(new TestObject("seventh", 2));
            a.add(new TestObject("eighth", 8));
            a.add(new TestObject("nineth", 7));
            a.add(new TestObject("tenth", 6));
            c = new TestObjectComparator();
            Collections.sort(a, c);
            b = new ArrayList <TestObject>();
            b.add(new TestObject("second", 2));
            b.add(new TestObject("seventh", 2));
            b.add(new TestObject("first", 3));
            b.add(new TestObject("sixth", 3));
            b.add(new TestObject("fifth", 6));
            b.add(new TestObject("tenth", 6));
            b.add(new TestObject("fourth", 7));
            b.add(new TestObject("nineth", 7));
            b.add(new TestObject("third", 8));
            b.add(new TestObject("eighth", 8));
            d = b.equals(a);
            Assert.AreEqual(true, d);
        }
        public void binarySearchTest2()
        {
            ArrayList <TestObject> a;
            int b;
            TestObjectComparator c;

            a = new ArrayList <TestObject>();
            a.add(new TestObject("first", 3));
            a.add(new TestObject("second", 2));
            a.add(new TestObject("third", 8));
            a.add(new TestObject("fourth", 7));
            a.add(new TestObject("fifth", 6));
            a.add(new TestObject("sixth", 3));
            a.add(new TestObject("seventh", 2));
            a.add(new TestObject("eighth", 8));
            a.add(new TestObject("nineth", 7));
            a.add(new TestObject("tenth", 6));
            c = new TestObjectComparator();
            Collections.sort(a);
            b = Collections.binarySearch(a, new TestObject("sixth", 6), c);
            Assert.AreEqual(4, b);
            b = Collections.binarySearch(a, new TestObject("sixth", 4), c);
            Assert.AreEqual(-5, b);
        }