### Question:
EventRegistrationService { @Transactional public Person createPerson(String name) { if (name == null || name.trim().length() == 0) { throw new IllegalArgumentException("Person name cannot be empty!"); } else if (personRepository.existsById(name)) { throw new IllegalArgumentException("Person has already been created!"); } Person person = new Person(); person.setName(name); personRepository.save(person); return person; }  @Transactional Person createPerson(String name); @Transactional Person getPerson(String name); @Transactional List<Person> getAllPersons(); @Transactional Event buildEvent(Event event, String name, Date date, Time startTime, Time endTime); @Transactional Event createEvent(String name, Date date, Time startTime, Time endTime); @Transactional Event getEvent(String name); @Transactional List<Event> getAllEvents(); @Transactional Registration register(Person person, Event event); @Transactional List<Registration> getAllRegistrations(); @Transactional Registration getRegistrationByPersonAndEvent(Person person, Event event); @Transactional List<Registration> getRegistrationsForPerson(Person person); @Transactional List<Registration> getRegistrationsByPerson(Person person); @Transactional List<Event> getEventsAttendedByPerson(Person person);  }### Answer:
@Test public void testCreatePerson() { assertEquals(0, service.getAllPersons().size()); String name = "Oscar"; try { service.createPerson(name); } catch (IllegalArgumentException e) { fail(); } List<Person> allPersons = service.getAllPersons(); assertEquals(1, allPersons.size()); assertEquals(name, allPersons.get(0).getName()); }