On 09/20/2013 09:46 PM, Martin Buchholz wrote:
Both Collections.emptyList and Collections.singleton are serializable.
I think of Optional as a zero-or-one collection, so it should be serializable too.



Hi Martin,
if Optional is a zero-or-one collection, it should implements Collection, it doesn't.
Optional is the result of a computation that can be something or none.

If you want to see Optional as a collection of zero-or-one element,
I think it's better to have a method asSet like Guava.

cheers,
Rémi

Reply via email to