How to convert Map<X, Map<Y,Z>>
to Map<Y, Map<X,Z>>
using Java8 stream.
Input:
{A : {B : C, D : E}} // Here B and D are the Key of inner map for A key
{F : {B : G, D : H}} // Here B and D are the Key of inner map for F key
Output:
{B : {A : C, F : G}} // Here A and F are the Key of inner map for B key
{D : {A : E, F : H}} // Here A and F are the Key of inner map for D key