### Question:
TaskHistoryEventRepresentationModelAssembler implements RepresentationModelAssembler<TaskHistoryEvent, TaskHistoryEventRepresentationModel> { @NonNull @Override public TaskHistoryEventRepresentationModel toModel(@NonNull TaskHistoryEvent historyEvent) { TaskHistoryEventRepresentationModel repModel = new TaskHistoryEventRepresentationModel(); repModel.setTaskHistoryId(historyEvent.getId()); repModel.setBusinessProcessId(historyEvent.getBusinessProcessId()); repModel.setParentBusinessProcessId(historyEvent.getParentBusinessProcessId()); repModel.setTaskId(historyEvent.getTaskId()); repModel.setEventType(historyEvent.getEventType()); repModel.setCreated(historyEvent.getCreated()); repModel.setUserId(historyEvent.getUserId()); repModel.setDomain(historyEvent.getDomain()); repModel.setWorkbasketKey(historyEvent.getWorkbasketKey()); repModel.setPorCompany(historyEvent.getPorCompany()); repModel.setPorType(historyEvent.getPorType()); repModel.setPorInstance(historyEvent.getPorInstance()); repModel.setPorSystem(historyEvent.getPorSystem()); repModel.setPorValue(historyEvent.getPorValue()); repModel.setTaskClassificationKey(historyEvent.getTaskClassificationKey()); repModel.setTaskClassificationCategory(historyEvent.getTaskClassificationCategory()); repModel.setAttachmentClassificationKey(historyEvent.getAttachmentClassificationKey()); repModel.setOldValue(historyEvent.getOldValue()); repModel.setNewValue(historyEvent.getNewValue()); repModel.setCustom1(historyEvent.getCustomAttribute(TaskHistoryCustomField.CUSTOM_1)); repModel.setCustom2(historyEvent.getCustomAttribute(TaskHistoryCustomField.CUSTOM_2)); repModel.setCustom3(historyEvent.getCustomAttribute(TaskHistoryCustomField.CUSTOM_3)); repModel.setCustom4(historyEvent.getCustomAttribute(TaskHistoryCustomField.CUSTOM_4)); repModel.setDetails(historyEvent.getDetails()); try { repModel.add( linkTo( methodOn(TaskHistoryEventController.class) .getTaskHistoryEvent(historyEvent.getId())) .withSelfRel()); } catch (Exception e) { throw new SystemException("caught unexpecte Exception", e); } return repModel; }  @NonNull @Override TaskHistoryEventRepresentationModel toModel(@NonNull TaskHistoryEvent historyEvent);  }### Answer:
@Test void taskHistoryEventModelToResource() { TaskHistoryEvent historyEvent = new TaskHistoryEvent(); historyEvent.setEventType("TASK_CREATED"); historyEvent.setBusinessProcessId("BPI:01"); historyEvent.setParentBusinessProcessId("BPI:02"); historyEvent.setTaskId("TKI:000000000000000000000000000000000000"); historyEvent.setTaskClassificationCategory("MANUAL"); historyEvent.setDomain("DOMAIN_A"); historyEvent.setWorkbasketKey("WorkbasketKey"); historyEvent.setAttachmentClassificationKey("L1050"); historyEvent.setCreated(Instant.now()); historyEvent.setOldValue("oldValue"); historyEvent.setNewValue("newValue"); historyEvent.setPorCompany("porCompany"); historyEvent.setPorSystem("porSystem"); historyEvent.setPorType("porType"); historyEvent.setPorValue("porValue"); historyEvent.setCustomAttribute(TaskHistoryCustomField.CUSTOM_1, "custom1"); historyEvent.setCustomAttribute(TaskHistoryCustomField.CUSTOM_2, "custom2"); historyEvent.setCustomAttribute(TaskHistoryCustomField.CUSTOM_3, "custom3"); historyEvent.setCustomAttribute(TaskHistoryCustomField.CUSTOM_4, "custom4"); TaskHistoryEventRepresentationModel taskHistoryEventRepresentationModel = taskHistoryEventRepresentationModelAssembler.toModel(historyEvent); testEquality(historyEvent, taskHistoryEventRepresentationModel); }