title: Spotbugs + Java: may expose internal representation by storing an externally mutable object into QuestionPojo.map
body: <p>Small question regarding a Spotbug finding I am having a hard time to fix please.</p>
  <p>On this super simple POJO:</p>
  <pre><code>import java.util.Map;
  
  public class QuestionPojo {
  
      private final Map&lt;String, String&gt; map;
  
      public QuestionPojo(Map&lt;String, String&gt; map) {
          this.map = map;
      }
  
      public Map&lt;String, String&gt; getMap() {
          return map;
      }
  
      @Override
      public String toString() {
          return &quot;QuestionPojo{&quot; +
                  &quot;map=&quot; + map +
                  '}';
      }
      
  }
  </code></pre>
  <p>I am getting flag on the <code>map</code> with <code>may expose internal representation by storing an externally mutable object into QuestionPojo.map</code></p>
  <p>One time on <code>this.map = map;</code></p>
  <p>Another one on the getter <code>return map</code>.</p>
  <p>I tried invoking a possible <code>clone()</code> method, but it seems it is not supported in Map.</p>
  <p>How do I fix this please?</p>
  <p>Thank you</p>