I have a list of class A and class B with no duplicate elements. "code" attribute will be same across both class A and B. I want to convert them to Map