// 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);
// 	}
// }


import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.test.Verify;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import org.junit.Assert;
import org.junit.Test;

    private void guiChangesClarkKent(Person person)
    {
        Assert.assertNotNull(person);
        person.setName("Superman");
        person.setAge(28);
    }

    @Test
    public void testQ1()
    {
        this.giveClarkKentToGui();

        Person clarkKent = PersonFinder.findOne(PersonFinder.personId().eq(5));

        Assert.assertEquals("Clark Kent", clarkKent.getName());
        Assert.assertEquals(38, clarkKent.getAge());
    }

//-------------- Question 2 ------------------------------------------------------
// Accept a changed object from the [simulated] GUI, and persist the changes.

    public void persistClarkKentChangesFromGui(Person person)
    {
        Assert.fail("Implement this functionality to make the test pass");
    }

    @Test
    public void testQ2()
    {
// 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: main-kata/src/test/java/kata/test/ExercisesDetachedObjects.java
import org.eclipse.collections.impl.block.factory.Predicates;
import org.eclipse.collections.impl.test.Verify;
import kata.domain.Person;
import kata.domain.PersonFinder;
import kata.domain.PersonList;
import org.junit.Assert;
import org.junit.Test;


    private void guiChangesClarkKent(Person person)
    {
        Assert.assertNotNull(person);
        person.setName("Superman");
        person.setAge(28);
    }

    @Test
    public void testQ1()
    {
        this.giveClarkKentToGui();

        Person clarkKent = PersonFinder.findOne(PersonFinder.personId().eq(5));

        Assert.assertEquals("Clark Kent", clarkKent.getName());
        Assert.assertEquals(38, clarkKent.getAge());
    }

//-------------- Question 2 ------------------------------------------------------
// Accept a changed object from the [simulated] GUI, and persist the changes.

    public void persistClarkKentChangesFromGui(Person person)
    {
        Assert.fail("Implement this functionality to make the test pass");
    }

    @Test
    public void testQ2()
    {
        int peopleBefore = new PersonList(PersonFinder.all()).count();