title: Easy way to access nested properties in a Map
body: <p>I use the following code to access directly to any property in a structure of nested maps as in the example.</p>
  
  <pre><code>import com.google.common.collect.ImmutableMap;
  import org.junit.Assert;
  import org.junit.Test;
  import org.springframework.beans.factory.config.YamlProcessor;
  import org.springframework.core.env.MapPropertySource;
  
  import java.util.Map;
  
  public class MapPropertySourceLearningTest {
  
      @Test
      public void testFlattenedMap() {
          Map map = ImmutableMap.of(
                  "meta", ImmutableMap.of(
                          "pagination", ImmutableMap.of(
                                  "position", "1",
                                  "itemsPerPage", "50",
                                  "totalPages", "9",
                                  "totalItems", "438"
                          )
                  )
          );
  
          MapPropertySource source = new MapPropertySource("map", new YamlProcessor() {
              public Map&lt;String, Object&gt; flatten(Map&lt;String, Object&gt; source) {
                  return super.getFlattenedMap(source);
              }
          }.flatten(map));
  
          Assert.assertEquals("1", source.getProperty("meta.pagination.position"));
          Assert.assertEquals("9", source.getProperty("meta.pagination.totalPages"));
      }
  
  
  }
  </code></pre>
  
  <p>I don't like having to extend YamlProcessor class. ¿ Is there a better way to achieve the same ?</p>