### Question:
Xs2aToSpiPsuDataMapper { public SpiPsuData mapToSpiPsuData(PsuIdData psuIdData) { return Optional.ofNullable(psuIdData) .map(this::builderWithPsuData) .orElseGet(SpiPsuData::builder) .build(); }  List<SpiPsuData> mapToSpiPsuDataList(List<PsuIdData> psuIdDataList); SpiPsuData mapToSpiPsuData(PsuIdData psuIdData);  }### Answer:
@Test void mapToSpiPsuData_WithAdditionalPsuData() { PsuIdData psuIdData = new PsuIdData(PSU_ID, PSU_ID_TYPE, PSU_CORPORATE_ID, PSU_CORPORATE_TYPE, PSU_IP_ADDRESS, buildAdditionalPsuData()); SpiPsuData spiPsuDataExpected = buildSpiPsuDataWithAdditionalPsuData(); SpiPsuData spiPsuDataActual = xs2aToSpiPsuDataMapper.mapToSpiPsuData(psuIdData); assertNotNull(spiPsuDataActual); Assertions.assertThat(spiPsuDataExpected).isEqualToComparingFieldByFieldRecursively(spiPsuDataActual); }
@Test void mapToSpiPsuData_WithoutAdditionalPsuData() { PsuIdData psuIdData = new PsuIdData(PSU_ID, PSU_ID_TYPE, PSU_CORPORATE_ID, PSU_CORPORATE_TYPE, PSU_IP_ADDRESS); SpiPsuData spiPsuDataExpected = buildSpiPsuDataWithoutAdditionalPsuData(); SpiPsuData spiPsuDataActual = xs2aToSpiPsuDataMapper.mapToSpiPsuData(psuIdData); assertNotNull(spiPsuDataActual); Assertions.assertThat(spiPsuDataExpected).isEqualToComparingFieldByFieldRecursively(spiPsuDataActual); }
@Test void mapToSpiPsuData_WithoutPsuData() { SpiPsuData spiPsuDataExpected = buildEmptySpiPsuData(); SpiPsuData spiPsuDataActual = xs2aToSpiPsuDataMapper.mapToSpiPsuData(null); assertNotNull(spiPsuDataActual); Assertions.assertThat(spiPsuDataExpected).isEqualToComparingFieldByFieldRecursively(spiPsuDataActual); }