title: Lombok inner collection initialization
body: <p>I use Lombok @Value annotation. Is it possible to somehow ensure, that inner collections will never be null?</p>
  
  <p>Example:</p>
  
  <pre><code>package com.testapp;
  
  import lombok.Value;
  import lombok.experimental.Wither;
  
  import java.util.List;
  
  @Value
  @Wither
  public final class ClassWithList {
  
      private final List&lt;String&gt; list;
  
      public void printList() {
          list.forEach(System.out::println);
      }
  
  }
  </code></pre>
  
  <p>This will throw a <code>NullPointerException</code> if <code>list</code> is null. My current strategy was to never allow to happen, that an inner collection may be null, it was sanitized in constructor (setter,  builder...) . However in this case is the constructor automatically generated by Lombok. Is there any way, how to ensure that the <code>list</code> property will always be initialized at least to an empty collection or do I have to start writing the tedious null checks?</p>