> >> > >> I don't (yet) want to be prescriptive in any potential solution. And I > >> know that this has been discussed before. I mostly just want to start a > >> conversation and see how much traction it gets. > >> > > Would > > java.util.SequencedMap.of(...) > > java.util.SequencedMap.copyOf(SequencedMap map) > > java.util.SequencedSet.of(...) > > java.util.SequencedSet.copyOf(SequencedSet set) > > solve your problem? > > > > I would love to see them included in JEP 431. > > Should be fairly simply to implement just have a side > > array that maintains the elements in order. > > I do not think SequenceMap or SequencedSet should be use for copyOf(), Map > and Collection should be used instead because the iteration order is enough.
Agreed, I realized it after having sent the mail. /Kasper