### Question:
EventRegistrationService { @Transactional public Event createEvent(String name, Date date, Time startTime, Time endTime) { Event event = new Event(); buildEvent(event, name, date, startTime, endTime); eventRepository.save(event); return event; }  @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 testCreateEvent() { assertEquals(0, service.getAllEvents().size()); String name = "Soccer Game"; Calendar c = Calendar.getInstance(); c.set(2017, Calendar.MARCH, 16, 9, 0, 0); Date eventDate = new Date(c.getTimeInMillis()); LocalTime startTime = LocalTime.parse("09:00"); c.set(2017, Calendar.MARCH, 16, 10, 30, 0); LocalTime endTime = LocalTime.parse("10:30"); try { service.createEvent(name, eventDate, Time.valueOf(startTime) , Time.valueOf(endTime)); } catch (IllegalArgumentException e) { fail(); } checkResultEvent(name, eventDate, startTime, endTime); }