2020import java .util .LinkedHashSet ;
2121import java .util .List ;
2222import java .util .Map ;
23+ import java .util .SequencedMap ;
24+ import java .util .SequencedSet ;
2325import java .util .Set ;
2426import java .util .SortedMap ;
2527import java .util .SortedSet ;
@@ -174,7 +176,7 @@ public static <E> List<E> emptyListOf(Class<E> elementType) {
174176 * A map containing the provided entries in the order given.
175177 */
176178 @ SafeVarargs
177- public static <K , V > Map <K , V > mapOf (Map .Entry <K , V >... entries ) {
179+ public static <K , V > SequencedMap <K , V > mapOf (Map .Entry <K , V >... entries ) {
178180 var map = new LinkedHashMap <K , V >(entries .length );
179181
180182 for (var entry : entries ) {
@@ -201,7 +203,7 @@ public static <K, V> Map<K, V> mapOf(Map.Entry<K, V>... entries) {
201203 * @return
202204 * A map containing the provided entries in the order given.
203205 */
204- public static <K , V > Map <K , V > mapOf (Iterable <? extends Map .Entry <? extends K , ? extends V >> entries ) {
206+ public static <K , V > SequencedMap <K , V > mapOf (Iterable <? extends Map .Entry <? extends K , ? extends V >> entries ) {
205207 if (entries == null ) {
206208 throw new IllegalArgumentException ();
207209 }
@@ -399,7 +401,7 @@ public static <K, V> Map.Entry<K, V> entry(K key, V value) {
399401 * A set containing the provided elements in the order given.
400402 */
401403 @ SafeVarargs
402- public static <E > Set <E > setOf (E ... elements ) {
404+ public static <E > SequencedSet <E > setOf (E ... elements ) {
403405 var set = new LinkedHashSet <E >(elements .length );
404406
405407 java .util .Collections .addAll (set , elements );
@@ -419,7 +421,7 @@ public static <E> Set<E> setOf(E... elements) {
419421 * @return
420422 * A set containing the provided elements in the order given.
421423 */
422- public static <E > Set <E > setOf (Iterable <? extends E > elements ) {
424+ public static <E > SequencedSet <E > setOf (Iterable <? extends E > elements ) {
423425 if (elements == null ) {
424426 throw new IllegalArgumentException ();
425427 }
0 commit comments