I am playing around with lazy functional operations in Java SE 8, and I want to map an index i to a pair / tuple (i, value[i]), then <
map
i
(i, value[i])
Since Java 9, you can create instances of Map.Entry easier than before:
Map.Entry
Entry pair = Map.entry(1, "a");
Map.entry returns an unmodifiable Entry and forbids nulls.
Entry