title: How to retrieve nested list from object using Stream API?
body: <p>Do you have any idea how to retrieve all <code>SimpleProperty</code> from <code>TopComplexity</code> object?
  I need to change that <strong>for loop</strong> into <strong>stream</strong> &quot;kind&quot; piece of code.</p>
  <pre class="lang-java prettyprint-override"><code>@Data
  public class TopComplexity {
     List&lt;SuperComplexProperty&gt; superComplexProperties;
  }
  @Data
  public class SuperComplexProperty {
     List&lt;SimpleProperty&gt; simpleProperties;
     ComplexProperty complexProperty;
  }
  
  @Data
  public class ComplexProperty {
     List&lt;SimpleProperty&gt; simpleProperties;
  }
  
  public class MainClass {
     public static void main(String[] args) {
  
         TopComplexity top = null;
         List&lt;SimpleProperty&gt; result = new ArrayList&lt;&gt;();
        
         for(SuperComplexProperty prop : top.getSuperComplexProperties) {
            result.addAll(prop.getSimpleProperties());
        
            if(Objects.nonNull(prop.getComplexProperty()) {
                result.addAll(prop.getComplexProperty().getSimpleProperties());
           }
        }
     }
  }
  </code></pre>
  <p>Really appreciate any kind of help</p>