Skip to content

Instantly share code, notes, and snippets.

private Map<Integer,? extends Address> getAddressIndex(Optional<SubjectData> currentSubjectData) {
return currentSubjectData
.map(subjectData -> subjectData
.getAddresses()
.stream()
.filter(address -> address.getEsoId() != null)
.collect(toMap(Address::getEsoId, t -> t))
)
.orElse(emptyMap())
;