Generic way for working with Map and custom POJO