### Question:
Xs2aToSpiAddressMapper { public SpiAddress mapToSpiAddress(Xs2aAddress address) { if (address == null) { return null; } return new SpiAddress( address.getStreetName(), address.getBuildingNumber(), address.getTownName(), address.getPostCode(), Optional.ofNullable(address.getCountry()).map(Xs2aCountryCode::getCode).orElse("")); }  SpiAddress mapToSpiAddress(Xs2aAddress address); Xs2aAddress mapToXs2aAddress(SpiAddress address);  }### Answer:
@Test void mapToSpiAddress() { Xs2aAddress xs2aAddress = jsonReader.getObjectFromFile("json/Xs2aAddress.json", Xs2aAddress.class); SpiAddress expectedSpiAddress = jsonReader.getObjectFromFile("json/SpiAddress.json", SpiAddress.class); SpiAddress actualSpiAddress = xs2aToSpiAddressMapper.mapToSpiAddress(xs2aAddress); assertEquals(expectedSpiAddress, actualSpiAddress); }
@Test void mapToSpiAddress_xs2aAddressIsNull() { Xs2aAddress xs2aAddress = null; SpiAddress actualSpiAddress = xs2aToSpiAddressMapper.mapToSpiAddress(xs2aAddress); assertNull(actualSpiAddress); }