표준 Collector를 결과 type에서 고르기
container, text, 대표값, 통계를 별도 factory에 연결한다.
| 원하는 결과 | Collector | 빈 결과 |
|---|---|---|
| 순서·중복 목록 | toList | empty List |
| 고유값 | toSet·toCollection | empty Set |
| 문자열 | joining | empty text |
| 통계 | summarizingInt | count 0 확인 |
| 대표 element | minBy·maxBy | Optional |
핵심: 반환 container의 mutability와 concrete implementation을 추측하지 않는다.