### Question:
CountryTransformer { CountryDTO toDto(Country country) { CountryDTO result = new CountryDTO(); if (null != country) { result.setCode( country.getCode() ); result.setName( country.getName() ); } return result; }    }### Answer:
@Test public void toDto_should_transform_the_do() { Country value = new Country(1L, 1L, "FR", "France"); CountryDTO result = cut.toDto(value); Assertions.assertThat(result).isNotNull(); Assertions.assertThat(result.getCode()).isEqualTo("FR"); Assertions.assertThat(result.getName()).isEqualTo("France"); }
@Test public void toDto_should_return_empty_object_if_do_is_null() { CountryDTO result = cut.toDto(null); Assertions.assertThat(result).isNotNull(); Assertions.assertThat(result.getCode()).isNull(); Assertions.assertThat(result.getName()).isNull(); }