Use of Optional in a map
Ok before I start explaining my question I want you to know that I know about the design idea behind Optional and that it isn't intended to be used in fields or collections, but I have programmed a lot in Kotlin currently and really dislike using null . So I have a Node based editor like in the Unreal Engine and each node has ConnectionBox es, which can be either free or are occupied by a Connection . So there are different ways to express this one of which is using a map that maps each ConnectionBox to a Connection like: Map<ConnectionBox, Connection> connectionEndPoints; and Connection could