@@ -1034,7 +1034,6 @@ The `Collections` class provides a set of static utility methods for declarative
10341034``` java
10351035public static < E > List<E > listOf(E . .. elements) { ... }
10361036public static < K , V > Map<K , V > mapOf(Map . Entry<K , V > ... entries) { ... }
1037- public static < K , V > Map . Entry<K , V > entry(K key, V value) { ... }
10381037public static < E > Set<E > setOf(E . .. elements) { ... }
10391038```
10401039
@@ -1046,6 +1045,12 @@ public static <K, V> Map<K, V> immutableMapOf(Map.Entry<K, V>... entries) { ...
10461045public static < E > Set<E > immutableSetOf(E . .. elements) { ... }
10471046```
10481047
1048+ This method can be used to declare entries for either ` mapOf() ` or ` immutableMapOf() ` :
1049+
1050+ ``` java
1051+ public static < K , V > Map . Entry<K , V > entry(K key, V value) { ... }
1052+ ```
1053+
10491054` Collections ` also includes support for declaring empty lists, maps, and sets:
10501055
10511056``` java
@@ -1063,8 +1068,8 @@ var list2 = emptyListOf(Integer.class);
10631068var map1 = java.util. Collections . < String , Integer > emptyMap();
10641069var map2 = emptyMapOf(String . class, Integer . class);
10651070
1066- var set1 = java.util. Collections . < Integer > emptySet();
1067- var set2 = emptySetOf(Integer . class);
1071+ var set1 = java.util. Collections . < String > emptySet();
1072+ var set2 = emptySetOf(String . class);
10681073```
10691074
10701075The ` Optionals ` class contains methods for working with optional (or "nullable") values:
0 commit comments