### Question:
ArtifactExpiryReceipt extends Receipt { public byte[] serialize() { short version = (short) getVersion().getValue(); ReceiptTypeDto type = ReceiptTypeDto.rawValueOf((short) getType().getValue()); if (this.artifactId instanceof MosaicId) { return MosaicExpiryReceiptBuilder.create( version, type, new MosaicIdDto(getArtifactIdValue().longValue())) .serialize(); } else { return NamespaceExpiryReceiptBuilder.create( version, type, new NamespaceIdDto(getArtifactIdValue().longValue())) .serialize(); } } ArtifactExpiryReceipt(
      T artifactId, ReceiptType type, ReceiptVersion version, Optional<Integer> size);  ArtifactExpiryReceipt(T artifactId, ReceiptType type, ReceiptVersion version); T getArtifactId(); byte[] serialize();  }### Answer:
@Test void shouldMosaicExpiryReceiptBuilderSerialize() { MosaicId mosaicId = new MosaicId("85BBEA6CC462B244"); MosaicExpiryReceiptBuilder builder = MosaicExpiryReceiptBuilder.create( (short) 1, ReceiptTypeDto.INFLATION, new MosaicIdDto(mosaicId.getId().longValue())); byte[] serialize = builder.serialize(); Assertions.assertEquals(12, serialize.length); Assertions.assertEquals(16, builder.getSize()); String hex = ConvertUtils.toHex(serialize); Assertions.assertEquals("0100435144B262C46CEABB85", hex); }