int nbApplications1 = testProgram1.getApplications().size();
Edit instance = new Edit();
// Create a fresh new application
VolunteerApplication application = new VolunteerApplication();
application.setIdApplication(TEST_ID);
application.setProgram(testProgram1);
// Create and persist the volunteer
Volunteer volunteer = new Volunteer();
volunteer.setIdContact(TEST_ID);
volunteer.setFirstName(getName());
volunteer.setLastName(getName());
volunteer.setTypeVolunteer("Potential");
volunteer = volunteerCtrl.update(volunteer);
// test the method
instance.persist(volunteer, application, null);
//Refresh
application = applicationCtrl.read(TEST_ID);
testProgram1 = programCtrl.read(testProgram1.getIdProgram());
assertNotNull(application);
assertNotNull(application.getVolunteer());
assertEquals((long) TEST_ID, (long) application.getVolunteer().getIdContact());
assertEquals("Potential", application.getVolunteer().getTypeVolunteer());
applications = new ArrayList<VolunteerApplication>
(testProgram1.getApplications());
assertTrue("Cannot find the application in the program", applications.contains(application));
assertEquals("The number of application should have increased", nbApplications1+1, applications.size());