### Question:
ErrorTransformer { ErrorWithProblemsDTO toDto(Error error) { ErrorWithProblemsDTO result = new ErrorWithProblemsDTO(); result.setId(0L); if (null != error) { result.setId(error.getId()); result.setStep(error.getStep()); result.setStepDefinition(error.getStepDefinition()); result.setStepLine(error.getStepLine()); result.setException(error.getException()); List<Problem> problems = error.getProblemPatterns().stream() .map(ProblemPattern::getProblem) .sorted(Comparator.nullsLast(Problem::compareTo)) .distinct() .collect(Collectors.toList()); result.setProblems(problemTransformer.toDtos(problems)); } return result; }    }### Answer:
@Test public void toDto_should_return_an_empty_object_on_null() { ErrorWithProblemsDTO result = cut.toDto(null); Assertions.assertThat(result).isNotNull(); Assertions.assertThat(result.getId()).isEqualTo(0L); Assertions.assertThat(result.getStep()).isNull(); Assertions.assertThat(result.getStepDefinition()).isNull(); Assertions.assertThat(result.getStepLine()).isEqualTo(0); Assertions.assertThat(result.getException()).isNull(); }