~/talk

Exploring Collectors

Talkat Devoxx Belgium 2019 · 2019-11-04..11-08· [java]
slides:none on file

Walks through concrete Java Stream code showing where Collectors replace error-prone reduce/for-each patterns, demonstrates Collectors utility class methods (toList/toSet/toUnmodifiableList, joining, groupingBy, partitioningBy, mapping, counting, collectingAndThen, maxBy/minBy, teeing, flatMap) and live-codes conversions (map→collect, map+flatMap, grouping to buckets, counting yields Long→int via collectingAndThen). Reproduces a race bug from shared mutation and proves collectors work with parallel streams, argues to avoid shared mutability and prefer immutable collectors for correct, concurrent results.

AI-written summary · about

  1. 0:00Introduction
  2. 1:18Why Java
  3. 2:37Create People
  4. 8:23Reduce
  5. 14:04Lazy Evaluation
  6. 15:00Immutability
  7. 16:32Programming languages
  8. 17:39Example
  9. 23:58Reduce Function
  10. 25:12Combine Collections
  11. 29:37Collectors
  12. 33:34Using Collectors
  13. 35:27Creating a Map
  14. 38:10Create a Map
  15. 40:01Get a List of Ages
  16. 41:08Unmodifiable Lists
  17. 42:31commaseparated lists
  18. 45:30collecting
  19. 47:07filters
  20. 50:20partitioning
  21. 52:04by name
  22. 54:07add
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.