### Question:
FolderMapper implements EntityMapper<Folder> { @Override public XContentBuilder map(final EntityContainer<Folder> container) { Folder folder = container.getEntity(); try (XContentBuilder jsonBuilder = XContentFactory.jsonBuilder()) { jsonBuilder .startObject() .field(DOC_TYPE_FIELD, SearchDocumentType.FOLDER.name()) .field("id", folder.getId()) .field("name", folder.getName()) .field("parentId", folder.getParentId()) .field("createdDate", parseDataToString(folder.getCreatedDate())); buildUserContent(container.getOwner(), jsonBuilder); buildMetadata(container.getMetadata(), jsonBuilder); buildPermissions(container.getPermissions(), jsonBuilder); jsonBuilder.endObject(); return jsonBuilder; } catch (IOException e) { throw new IllegalArgumentException("Failed to create elasticsearch document for pipeline folder: ", e); } }  @Override XContentBuilder map(final EntityContainer<Folder> container);  }### Answer:
@Test void shouldMapFolder() throws IOException { FolderMapper mapper = new FolderMapper(); Folder folder = new Folder(1L); folder.setName(TEST_NAME); folder.setParentId(1L); EntityContainer<Folder> container = EntityContainer.<Folder>builder() .entity(folder) .owner(USER) .metadata(METADATA) .permissions(PERMISSIONS_CONTAINER) .build(); XContentBuilder contentBuilder = mapper.map(container); verifyFolder(folder, contentBuilder); verifyPipelineUser(USER, contentBuilder); verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder); verifyMetadata(EXPECTED_METADATA, contentBuilder); }