### Question:
ReferenceIdOverrider implements ReferenceOverrider { @Override public void override(UserTask userTask) { String oldFormKey = userTask.getFormKey(); String newFormKey = modelIdentifiers.get(oldFormKey); if (newFormKey != null) { userTask.setFormKey(newFormKey); } } ReferenceIdOverrider(Map<String, String> modelIdentifiers); @Override void override(UserTask userTask); @Override void override(StartEvent startEvent);  }### Answer:
@Test public void should_overrideUserTask_when_notNewFormKey() { UserTask userTask = new UserTask(); userTask.setFormKey("notNewFormKey"); referenceIdOverrider.override(userTask); assertThat(userTask.getFormKey()).isEqualTo("notNewFormKey"); }
@Test public void should_overrideStartEvent_when_hasNewFormKey() { StartEvent startEvent = new StartEvent(); startEvent.setFormKey("oldFormKey"); referenceIdOverrider.override(startEvent); assertThat(startEvent.getFormKey()).isEqualTo("newFormKey"); }
@Test public void should_notOverrideStartEvent_when_sameFormKey() { StartEvent startEvent = new StartEvent(); startEvent.setFormKey("sameFormKey"); referenceIdOverrider.override(startEvent); assertThat(startEvent.getFormKey()).isEqualTo("sameFormKey"); }
@Test public void should_overrideStartEvent_when_notNewFormKey() { StartEvent startEvent = new StartEvent(); startEvent.setFormKey("notNewFormKey"); referenceIdOverrider.override(startEvent); assertThat(startEvent.getFormKey()).isEqualTo("notNewFormKey"); }
@Test public void should_overrideUserTask_when_hasNewFormKey() { UserTask userTask = new UserTask(); userTask.setFormKey("oldFormKey"); referenceIdOverrider.override(userTask); assertThat(userTask.getFormKey()).isEqualTo("newFormKey"); }
@Test public void should_notOverrideUserTask_when_sameFormKey() { UserTask userTask = new UserTask(); userTask.setFormKey("sameFormKey"); referenceIdOverrider.override(userTask); assertThat(userTask.getFormKey()).isEqualTo("sameFormKey"); }