This seems to fit your requirement:
Map<String, Set<Map.Entry<String, String>>> map = new HashMap<>();
Set<Map.Entry<String, String>> value1 = new HashSet<>();
value1.add(new AbstractMap.SimpleEntry<>("1", "2"));
value1.add(new AbstractMap.SimpleEntry<>("3", "4"));
value1.add(new AbstractMap.SimpleEntry<>("5", "6"));
map.put("1", value1);
Set<Map.Entry<String, String>> value2 = new HashSet<>();
value2.add(new AbstractMap.SimpleEntry<>("1", "2"));
value2.add(new AbstractMap.SimpleEntry<>("3", "4"));
value2.add(new AbstractMap.SimpleEntry<>("5", "6"));
map.put("2", value2);
System.out.println(map);
Output:
{1=[1=2, 5=6, 3=4], 2=[1=2, 5=6, 3=4]}
Or this:
Map<String, Map<String, String>> map = new HashMap<>();
Map<String, String> value1 = new HashMap<>();
value1.put("1", "2");
value1.put("3", "4");
value1.put("5", "6");
map.put("1", value1);
Map<String, String> value2 = new HashMap<>();
value2.put("1", "2");
value2.put("3", "4");
value2.put("5", "6");
map.put("2", value2);
System.out.println(map);
Output:
{1={1=2, 3=4, 5=6}, 2={1=2, 3=4, 5=6}}
Your follow-up question:
How would I get the pair given the key in a pair. For example, if I had the key 5, how could I get the pair 5=6 from the first element?
Here you go:
System.out.println(map.get("1").get("5"));