Skip to content

Instantly share code, notes, and snippets.

@jeserkin
Last active October 24, 2017 07:17
Show Gist options
  • Select an option

  • Save jeserkin/9cf27838306ce1e1739ed3b6257e7d82 to your computer and use it in GitHub Desktop.

Select an option

Save jeserkin/9cf27838306ce1e1739ed3b6257e7d82 to your computer and use it in GitHub Desktop.
private Collection<String> aggregateSomething(Based on) {
// validationResults is list of objects, that have method `giveMeSomething`. Need to call it in map
return Optional.of(on.getThisSomethingCollection())
.map(validationResults -> ...)
.ifPresent(Collectors.toSet());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment