### Question:
ErrorTransformer { List<ErrorWithProblemsDTO> toDtos(Collection<Error> errors) { if (null == errors) { return new ArrayList<>(); } return errors.stream() .map(this::toDto) .collect(Collectors.toList()); }    }### Answer:
@Test public void toDtos_should_return_empty_list_on_empty_list() { List<ErrorWithProblemsDTO> results = cut.toDtos(new ArrayList<>()); Assertions.assertThat(results).isNotNull(); Assertions.assertThat(results).isEmpty(); }
@Test public void toDtos_should_return_empty_list_on_null() { List<ErrorWithProblemsDTO> results = cut.toDtos(null); Assertions.assertThat(results).isNotNull(); Assertions.assertThat(results).isEmpty(); }