Skip to content

Instantly share code, notes, and snippets.

@novoj
Last active August 29, 2015 14:11
Show Gist options
  • Save novoj/9e6b42fb4ab75606a9b3 to your computer and use it in GitHub Desktop.
Save novoj/9e6b42fb4ab75606a9b3 to your computer and use it in GitHub Desktop.
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()
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment