### Question:
MentionsLegacyEventConverter extends AbstractLegacyEventConverter { @Override public Event convertLegacyActivityToEvent(LegacyEvent e) { Event event = super.convertLegacyActivityToEvent(e); if (!StringUtils.isEmpty(e.getParam3())) { event.setParameters(singletonMap(MentionsRecordableEventConverter.MENTIONS_PARAMETER_KEY, e.getParam3())); } return event; }  @Override LegacyEvent convertEventToLegacyActivity(Event e); @Override Event convertLegacyActivityToEvent(LegacyEvent e);  }### Answer:
@Test void convertLegacyActivityToEventWithoutActivityParameterKey() { this.mockCreateRawEvent(); this.mockEntityReferenceResolve(); LegacyEvent e = new LegacyEvent(); Event actual = this.activityPubLegacyEventConverter.convertLegacyActivityToEvent(e); assertFalse(actual.getParameters().containsKey(MentionsRecordableEventConverter.MENTIONS_PARAMETER_KEY)); }
@Test void convertLegacyActivityToEventWithActivityParameterKey() { this.mockCreateRawEvent(); this.mockEntityReferenceResolve(); LegacyEvent e = new LegacyEvent(); e.setParam3("randomValue2"); Event actual = this.activityPubLegacyEventConverter.convertLegacyActivityToEvent(e); assertEquals("randomValue2", actual.getParameters().get(MentionsRecordableEventConverter.MENTIONS_PARAMETER_KEY)); }