Skip to content

Instantly share code, notes, and snippets.

@trishagee
Created May 14, 2020 09:39
Show Gist options
  • Select an option

  • Save trishagee/3d4f5af1b7e1152a634e150405af0322 to your computer and use it in GitHub Desktop.

Select an option

Save trishagee/3d4f5af1b7e1152a634e150405af0322 to your computer and use it in GitHub Desktop.
List.of(manager1, manager2).stream()
.flatMap(m ->
Stream.concat(m.getEmployeeList().stream(), Stream.of(m)))
.distinct()
.mapToInt(Employee::getYearlySalary)
.sum();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment