}
private void internalTestAddRemoveAndGet(IntroductorList introductor) {
// Add a new employee:
Employee emp3 = new Employee();
emp3.setMatriculationCode("3");
introductor.add(emp3);
assertEquals(3, introductor.size());
// Test that the new employee is equal to the added employee using matriculation codes ...
assertTrue(emp3.getMatriculationCode().equals(((EmployeeView) introductor.get(2)).getMatriculationCode()));
// Because testing using equals() would fail, due to how Spring AOP works when intercepting the equals() method:
assertFalse(introductor.get(2).equals(emp3));
// However, PLEASE NOTE that the two objects are actually equals!
// Remove the employee previously added:
introductor.remove(2);
assertEquals(introductor.size(), 2);
// Add again a new employee:
Employee emp33 = new Employee();
emp33.setMatriculationCode("33");
introductor.add(emp33);
assertEquals(3, introductor.size());
// Test that the new employee is equal to the added employee using matriculation codes ...
assertTrue(emp33.getMatriculationCode().equals(((EmployeeView) introductor.get(2)).getMatriculationCode()));
// Because testing using equals() would fail, due to how Spring AOP works when intercepting the equals() method:
assertFalse(introductor.get(2).equals(emp3));
// However, PLEASE NOTE that the two objects are actually equals!
}