Collector < T , ? , Optional < T >> function ( ) { return ( Collector ) TO_OPTIONAL ; }
a collector that converts a stream of zero or one elements to an optional . the returned collector throws an illegalargumentexception if the stream consists of two or moreelements , and a nullpointerexception if the stream consists of exactly one element , which is null . concode_field_sep Collector<Object,?,Optional<Object>> TO_OPTIONAL concode_elem_sep Object NULL_PLACEHOLDER concode_elem_sep Collector<Object,?,Object> ONLY_ELEMENT concode_elem_sep int MAX_EXTRAS concode_elem_sep List<Object> extras concode_elem_sep Object element concode_field_sep Collector<T,?,T> onlyElement concode_elem_sep void add concode_elem_sep Optional<Object> getOptional concode_elem_sep Object getElement concode_elem_sep IllegalArgumentException multiples concode_elem_sep ToOptionalState combine