@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)); }
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 { 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 { 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); }
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); }
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);  }