### Question:
BoundaryEventPropertyWriter extends CatchEventPropertyWriter { @Override public void addEventDefinition(EventDefinition eventDefinition) { this.event.getEventDefinitions().add(eventDefinition); } BoundaryEventPropertyWriter(BoundaryEvent event, VariableScope variableScope, Set<DataObject> dataObjects); @Override void setCancelActivity(Boolean value); void setParentActivity(ActivityPropertyWriter parent); @Override void addEventDefinition(EventDefinition eventDefinition); @Override void setAbsoluteBounds(Node<? extends View, ?> node);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testAddEventDefinition() { List<EventDefinition> eventDefinitions = mock(List.class); when(element.getEventDefinitions()).thenReturn(eventDefinitions); EventDefinition eventDefinition = mock(EventDefinition.class); propertyWriter.addEventDefinition(eventDefinition); verify(eventDefinitions).add(eventDefinition); }
@Test @SuppressWarnings("unchecked") public void testAddEventDefinition() { EList<EventDefinition> eventDefinitions = spy(ECollections.newBasicEList()); when(element.getEventDefinitions()).thenReturn(eventDefinitions); EventDefinition eventDefinition = mock(EventDefinition.class); propertyWriter.addEventDefinition(eventDefinition); verify(eventDefinitions).add(eventDefinition); }