SyntaxFix
Write A Post
Hire A Developer
Questions
If you only need to add one value to the map you can use Collections.singletonMap:
Map<K, V> map = Collections.singletonMap(key, value)