I have a list of two hash maps with the same set of keys but different values.
Map<String, String> map1 = new HashMap<>();
map1.put("t1", "val1");
map1.put("t2", "val2");
map1.put("t3", "val3");
Map<String, String> map2 = new HashMap<>();
map2.put("t1", "str1");
map2.put("t2", "str2");
map2.put("t3", "str3");
I want to generate an excel sheet such that the keys will be in the header row, and all values will come under it as below:
t1 t2 t3
val1 val2 val3
str1 str2 str3
Can anyone suggest a way out of it?