### Question:
Xs2aToSpiAccountReferenceMapper { public List<SpiAccountReference> mapToSpiAccountReferences(List<AccountReference> references) { if (CollectionUtils.isEmpty(references)) { return Collections.emptyList(); } return references.stream() .map(ref -> Optional.ofNullable(ref).map(this::mapToSpiAccountReference).orElse(null)) .filter(Objects::nonNull) .collect(Collectors.toList()); }  List<SpiAccountReference> mapToSpiAccountReferences(List<AccountReference> references); List<SpiAccountReference> mapToSpiAccountReferencesOrDefault(List<AccountReference> references, List<SpiAccountReference> defaultValue); SpiAccountReference mapToSpiAccountReference(AccountReference account);  }### Answer:
@Test void mapToSpiAccountReferences() { AccountReference accountReference = jsonReader.getObjectFromFile("json/service/mapper/spi_xs2a_mappers/account-reference.json", AccountReference.class); List<SpiAccountReference> actual = mapper.mapToSpiAccountReferences(Collections.singletonList(accountReference)); SpiAccountReference expected = jsonReader.getObjectFromFile("json/service/mapper/spi_xs2a_mappers/spi-account-reference.json", SpiAccountReference.class); assertEquals(expected, actual.get(0)); }
@Test void mapToSpiAccountReferences_nullValue() { List<SpiAccountReference> actual = mapper.mapToSpiAccountReferences(null); assertNotNull(actual); assertTrue(actual.isEmpty()); }