title: How to make Generic of list variable Serializable
body: <p>How can I make <code>private List &lt;T&gt; list;</code> or <code>private Map&lt;String, Value&gt; unknownData;</code> <strong>serializable</strong>? These are variable in my class whose parent is serializable but SonarQube is complaining about transient or Serializable change</p>
  
  <p><strong>myClass.java</strong></p>
  
  <pre><code>public class MyClass implements Serializable {
    private static final long serialVersionUID = 0L;
    protected  List&lt;T&gt;  list = new ArrayList&lt;T&gt;();
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FY48x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FY48x.png" alt="Screen shot of SonarQube complaint"></a></p>