<div dir="ltr"><div>Hello,</div><div><br></div><div>I am happily taking SequencedSet and SequencedMap into use, but one inconvenience I encounter is the lack of factory methods for the two.</div><div><br></div><div>In code where many (initial) collections have zero or one element (for later aggregation), I now write Set.of()/Set.of(one) and Map.of()/Map.of(key, value), as it makes the code shorter and more readable. Those collections are of course implicitly sequenced, but now I must make the variable type of the surrounding monad Set and Map, and simply assume that a LinkedHashSet or LinkedHashMap is used when a collection of more than one element is set, without requiring the interface type. This does not require any type casting, as I rely on the iteration order only, but the code loses some of its expressiveness.<br></div><div><br></div><div>I did not find any discussion around introducing factories for SequencedSet.of(...) and SequencedMap.of(...), similar to those that exist in the Set and Map interfaces. Was this ever considered, and if not, could it be?<br></div><div><br></div><div>Best regards, Rafael<br></div></div>