/**
 * Test the Step 3 AddressBook class.
 * This is a controller class called from
 * Tester.
 */
class TestAddressBook
{
    AddressBook   myBook;
    Person        person;


    public void setupArray( int N )
    {
        myBook = new AddressBook( N );

        //add N Person objects
        for (int i = 0; i < N; i++) {
            person = new Person("Ms. X"+i, 10, 'F');
            myBook.add( person );
        }
    }

    public void testSearch( )
    {
        //test for the end case
        person = myBook.search("Ms. X2");

        if ( person == null ) {
              System.out.println
                ("Error: Didn’t find the person it should");
        }
        else {
              System.out.println
                (person.getName() + " is found okay.");
        }
    }
}