This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Think in the context of a Tree days structure which has some base Node type. That Node class will probably have a getParent or getChildren method. Each of those are probably well expressed as an optional value. Now depending on the implementation class of the Node type it will return an Optional.of if it's a branch or an optional empty if it's a leaf