### Question:
AttachmentRepresentationModelAssembler implements RepresentationModelAssembler<Attachment, AttachmentRepresentationModel> { @NonNull @Override public AttachmentRepresentationModel toModel(@NonNull Attachment attachment) { AttachmentRepresentationModel repModel = new AttachmentRepresentationModel(); repModel.setAttachmentId(attachment.getId()); repModel.setTaskId(attachment.getTaskId()); repModel.setCreated(attachment.getCreated()); repModel.setModified(attachment.getModified()); repModel.setReceived(attachment.getReceived()); repModel.setClassificationSummary( classificationSummaryAssembler.toModel(attachment.getClassificationSummary())); repModel.setObjectReference(attachment.getObjectReference()); repModel.setChannel(attachment.getChannel()); repModel.setCustomAttributes(attachment.getCustomAttributeMap()); repModel.add(linkTo(AttachmentController.class).slash(attachment.getId()).withSelfRel()); return repModel; } @Autowired  AttachmentRepresentationModelAssembler(
      TaskService taskService,
      ClassificationSummaryRepresentationModelAssembler classificationSummaryAssembler); @NonNull @Override AttachmentRepresentationModel toModel(@NonNull Attachment attachment); Attachment toEntityModel(AttachmentRepresentationModel attachmentRepresentationModel);  }### Answer:
@Test void should_ReturnRepresentationModel_When_ConvertingEntityToRepresentationModel() { AttachmentImpl attachment = (AttachmentImpl) taskService.newAttachment(); ObjectReference reference = new ObjectReference(); ClassificationSummary summary = classService.newClassification("ckey", "cdomain", "MANUAL").asSummary(); reference.setId("abc"); attachment.setCustomAttributeMap(Collections.singletonMap("abc", "def")); attachment.setClassificationSummary(summary); attachment.setId("id"); attachment.setTaskId("taskId"); attachment.setChannel("channel"); attachment.setCreated(Instant.parse("2019-09-13T08:44:17.588Z")); attachment.setModified(Instant.parse("2019-09-13T08:44:17.588Z")); attachment.setObjectReference(reference); attachment.setReceived(Instant.parse("2019-09-13T08:44:17.588Z")); AttachmentRepresentationModel repModel = assembler.toModel(attachment); testEquality(attachment, repModel); testLinks(repModel); }