### Question:
JobUnitMapper { public List<JobUnit> transform(List<JobUnitEntity> entities) { List<JobUnit> list = new ArrayList<>(entities.size()); for (JobUnitEntity entity : entities) { if (entity != null) { JobUnit unit = transform(entity); list.add(unit); } } return list; } JobUnitMapper(JobUnitDateParser jobUnitDateParser); List<JobUnit> transform(List<JobUnitEntity> entities); JobUnit transform(JobUnitEntity entity);  }### Answer:
@Test public void should_map_collection_of_units() throws Exception { List<JobUnitEntity> entities = Collections.singletonList(mJobUnitEntity); List<JobUnit> expected = mJobUnitMapper.transform(entities); assertThat(expected.size(), is(1)); }
@Test public void should_map_entity_to_service_counterpart() throws Exception { JobUnit expected = mJobUnitMapper.transform(mJobUnitEntity); assertThat(expected.getId(), is(1)); assertThat(expected.getVersion(), is(100)); assertThat(expected.getLabel(), is("label")); assertThat(expected.getDescription(), is("description")); assertThat(expected.getReportUri(), is("/my/uri")); assertThat(expected.getReportLabel(), is("report label")); assertThat(expected.getOwner().toString(), is("jasperadmin|organization_1")); assertThat(expected.getState().toString(), is("NORMAL")); }