### Question:
AttachmentRepresentationModelAssembler implements RepresentationModelAssembler<Attachment, AttachmentRepresentationModel> { public Attachment toEntityModel(AttachmentRepresentationModel attachmentRepresentationModel) { AttachmentImpl attachment = (AttachmentImpl) taskService.newAttachment(); attachment.setId(attachmentRepresentationModel.getAttachmentId()); attachment.setTaskId(attachmentRepresentationModel.getTaskId()); attachment.setCreated(attachmentRepresentationModel.getCreated()); attachment.setModified(attachmentRepresentationModel.getModified()); attachment.setReceived(attachmentRepresentationModel.getReceived()); attachment.setClassificationSummary( classificationSummaryAssembler.toEntityModel( attachmentRepresentationModel.getClassificationSummary())); attachment.setObjectReference(attachmentRepresentationModel.getObjectReference()); attachment.setChannel(attachmentRepresentationModel.getChannel()); attachment.setCustomAttributeMap(attachmentRepresentationModel.getCustomAttributes()); return attachment; } @Autowired  AttachmentRepresentationModelAssembler(
      TaskService taskService,
      ClassificationSummaryRepresentationModelAssembler classificationSummaryAssembler); @NonNull @Override AttachmentRepresentationModel toModel(@NonNull Attachment attachment); Attachment toEntityModel(AttachmentRepresentationModel attachmentRepresentationModel);  }### Answer:
@Test void should_ReturnEntity_When_ConvertingRepresentationModelToEntity() { ObjectReference reference = new ObjectReference(); reference.setId("abc"); ClassificationSummaryRepresentationModel summary = new ClassificationSummaryRepresentationModel(); summary.setKey("keyabc"); summary.setDomain("DOMAIN_A"); summary.setType("MANUAL"); AttachmentRepresentationModel repModel = new AttachmentRepresentationModel(); repModel.setCustomAttributes(Collections.singletonMap("abc", "def")); repModel.setClassificationSummary(summary); repModel.setAttachmentId("id"); repModel.setTaskId("taskId"); repModel.setChannel("channel"); repModel.setCreated(Instant.parse("2019-09-13T08:44:17.588Z")); repModel.setModified(Instant.parse("2019-09-13T08:44:17.588Z")); repModel.setObjectReference(reference); repModel.setReceived(Instant.parse("2019-09-13T08:44:17.588Z")); Attachment attachment = assembler.toEntityModel(repModel); testEquality(attachment, repModel); }