Primitive Optional은 값 부재를 boxing 없이 표현한다
Optional<Integer>를 수치 hot path에서 반복하면 boxing이 생기지만 OptionalInt도 collection처럼 일반화되지는 않습니다.
| type | 값 | 대표 생산자 |
|---|---|---|
| OptionalInt | int 0..1 | IntStream.findFirst/min/max |
| OptionalLong | long 0..1 | LongStream terminal |
| OptionalDouble | double 0..1 | average |
| Optional<T> | reference 0..1 | 일반 query |
핵심: primitive stream terminal과 맞는 전문 type을 사용합니다.