// Path: main-kata/src/main/java/kata/domain/Person.java
// public class Person
//         extends PersonAbstract
// {
//     // Added for ExercisesAdvancedFinder question 9
//     public static final Procedure<Person> INCREMENT_AGE = new Procedure<Person>()
//     {
//         public void value(Person person)
//         {
//             person.incrementAge();
//         }
//     };
// 
// 	public Person()
// 	{
// 		super();
// 		// You must not modify this constructor. Mithra calls this internally.
// 		// You can call this constructor. You can also add new constructors.
// 	}
// 
//     // Added for ExercisesAdvancedFinder question 9
//     public void incrementAge()
//     {
//         this.setAge(this.getAge() + 1);
// 	}
// 
//     @Override
//     public String toString()
//     {
//         return "Person[name=" + this.getName()
//                 + "; country=" + this.getCountry()
//                 + "; age=" + this.getAge() + ']';
//     }
// }
// 
// Path: main-kata/src/main/java/kata/domain/PersonList.java
// public class PersonList
//         extends PersonListAbstract
// {
// 	public PersonList()
// 	{
// 		super();
// 	}
// 
// 	public PersonList(int initialSize)
// 	{
// 		super(initialSize);
// 	}
// 
// 	public PersonList(Collection c)
// 	{
// 		super(c);
// 	}
// 
// 	public PersonList(Operation operation)
// 	{
// 		super(operation);
// 	}
// }
// 
// Path: mini-kata/src/main/java/kata/domain/PetList.java
// public class PetList extends PetListAbstract
// {
//     public PetList()
//     {
//         super();
//     }
// 
//     public PetList(int initialSize)
//     {
//         super(initialSize);
//     }
// 
//     public PetList(Collection c)
//     {
//         super(c);
//     }
// 
//     public PetList(Operation operation)
//     {
//         super(operation);
//     }
// 
//     /**
//      * For each element in the list, print out petName() + " plays".
//      */
//     public void play()
//     {
//         throw new UnsupportedOperationException("Implement this as a part of kata.testExercise4Test.makePetsPlay");
//     }
// }


import com.gs.fw.common.mithra.finder.Operation;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import kata.domain.PetList;
import org.eclipse.collections.impl.test.Verify;
import org.junit.Assert;
import org.junit.Test;

    /**
     * There are no {@code Person} objects with {@code firstName} equal to "George".
     * Bulk update the {@code firstName} of only those {@code Person} objects with {@code lastName} equal to "Smith".
     * Use the appropriate method on {@link PersonFinder} and {@link PersonList}
     */
    @Test
    public void updateAllSmithsFirstNamesToGeorge()
    {
        Operation georgeSmithOperation = PersonFinder.firstName().eq("George").and(PersonFinder.lastName().eq("Smith"));

        PersonList georgeSmiths = PersonFinder.findMany(georgeSmithOperation);
        Verify.assertEmpty(georgeSmiths);

        /*
        Add the update logic here.
         */

        georgeSmiths = PersonFinder.findMany(georgeSmithOperation);
        Verify.assertSize(3, georgeSmiths);
    }

    /**
     * Insert a new {@code Person} object with first name: Jane and last name: Doe.
     * Do not add any {@code Pet}s to the new {@code Person} object.
     * Use appropriate method on {@link Person}.
     */
    @Test
    public void insertJaneDoe()
    {
// Path: main-kata/src/main/java/kata/domain/Person.java
// public class Person
//         extends PersonAbstract
// {
//     // Added for ExercisesAdvancedFinder question 9
//     public static final Procedure<Person> INCREMENT_AGE = new Procedure<Person>()
//     {
//         public void value(Person person)
//         {
//             person.incrementAge();
//         }
//     };
// 
// 	public Person()
// 	{
// 		super();
// 		// You must not modify this constructor. Mithra calls this internally.
// 		// You can call this constructor. You can also add new constructors.
// 	}
// 
//     // Added for ExercisesAdvancedFinder question 9
//     public void incrementAge()
//     {
//         this.setAge(this.getAge() + 1);
// 	}
// 
//     @Override
//     public String toString()
//     {
//         return "Person[name=" + this.getName()
//                 + "; country=" + this.getCountry()
//                 + "; age=" + this.getAge() + ']';
//     }
// }
// 
// Path: main-kata/src/main/java/kata/domain/PersonList.java
// public class PersonList
//         extends PersonListAbstract
// {
// 	public PersonList()
// 	{
// 		super();
// 	}
// 
// 	public PersonList(int initialSize)
// 	{
// 		super(initialSize);
// 	}
// 
// 	public PersonList(Collection c)
// 	{
// 		super(c);
// 	}
// 
// 	public PersonList(Operation operation)
// 	{
// 		super(operation);
// 	}
// }
// 
// Path: mini-kata/src/main/java/kata/domain/PetList.java
// public class PetList extends PetListAbstract
// {
//     public PetList()
//     {
//         super();
//     }
// 
//     public PetList(int initialSize)
//     {
//         super(initialSize);
//     }
// 
//     public PetList(Collection c)
//     {
//         super(c);
//     }
// 
//     public PetList(Operation operation)
//     {
//         super(operation);
//     }
// 
//     /**
//      * For each element in the list, print out petName() + " plays".
//      */
//     public void play()
//     {
//         throw new UnsupportedOperationException("Implement this as a part of kata.testExercise4Test.makePetsPlay");
//     }
// }


// Path: mini-kata/src/test/java/kata/test/Exercise1Test.java
import com.gs.fw.common.mithra.finder.Operation;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import kata.domain.PetList;
import org.eclipse.collections.impl.test.Verify;
import org.junit.Assert;
import org.junit.Test;


    /**
     * There are no {@code Person} objects with {@code firstName} equal to "George".
     * Bulk update the {@code firstName} of only those {@code Person} objects with {@code lastName} equal to "Smith".
     * Use the appropriate method on {@link PersonFinder} and {@link PersonList}
     */
    @Test
    public void updateAllSmithsFirstNamesToGeorge()
    {
        Operation georgeSmithOperation = PersonFinder.firstName().eq("George").and(PersonFinder.lastName().eq("Smith"));

        PersonList georgeSmiths = PersonFinder.findMany(georgeSmithOperation);
        Verify.assertEmpty(georgeSmiths);

        /*
        Add the update logic here.
         */

        georgeSmiths = PersonFinder.findMany(georgeSmithOperation);
        Verify.assertSize(3, georgeSmiths);
    }

    /**
     * Insert a new {@code Person} object with first name: Jane and last name: Doe.
     * Do not add any {@code Pet}s to the new {@code Person} object.
     * Use appropriate method on {@link Person}.
     */
    @Test
    public void insertJaneDoe()
    {
        Person janeDoe = PersonFinder.findOne(PersonFinder.firstName().eq("Jane").and(PersonFinder.lastName().eq("Doe")));