I\'d like to create new item that similarly to Util.Map.Entry that will contain the structure key, value.
Util.Map.Entry
key
value
The problem is that
org.apache.commons.lang3.tuple.Pair implements java.util.Map.Entry and can also be used standalone.
org.apache.commons.lang3.tuple.Pair
java.util.Map.Entry
Also as others mentioned Guava's com.google.common.collect.Maps.immutableEntry(K, V) does the trick.
com.google.common.collect.Maps.immutableEntry(K, V)
I prefer Pair for its fluent Pair.of(L, R) syntax.
Pair
Pair.of(L, R)