### Question:
PsuDataMapper { public PsuIdData mapToPsuIdData(PsuData psuData) { return Optional.ofNullable(psuData) .filter(PsuData::isNotEmpty) .map(psu -> new PsuIdData( psu.getPsuId(), psu.getPsuIdType(), psu.getPsuCorporateId(), psu.getPsuCorporateIdType(), psu.getPsuIpAddress(), mapToAdditionalPsuIdData(psu.getAdditionalPsuData()) )) .orElse(null); }  List<PsuData> mapToPsuDataList(List<PsuIdData> psuIdDataList, String instanceId); List<PsuIdData> mapToPsuIdDataList(List<PsuData> psuIdDataList); PsuData mapToPsuData(PsuIdData psuIdData, String instanceId); PsuIdData mapToPsuIdData(PsuData psuData);  }### Answer:
@Test void mapToPsuIdData_WithAdditionalPsuData() { PsuData psuData = jsonReader.getObjectFromFile("json/service/mapper/psu-data.json", PsuData.class); PsuIdData expected = jsonReader.getObjectFromFile("json/service/mapper/psu-id-data.json", PsuIdData.class); PsuIdData psuIdData = psuDataMapper.mapToPsuIdData(psuData); assertEquals(expected, psuIdData); }
@Test void mapToPsuIdData_WithoutAdditionalPsuData() { PsuData psuData = jsonReader.getObjectFromFile("json/service/mapper/psu-data-with-additional-psu-data.json", PsuData.class); PsuIdData expected = jsonReader.getObjectFromFile("json/service/mapper/psu-id-data-with-additional-psu-id-data.json", PsuIdData.class); PsuIdData psuIdData = psuDataMapper.mapToPsuIdData(psuData); assertEquals(expected, psuIdData); }