title: Nested lists with streams in Java8
body: <p>I have a list of objects A. Each object A in this list contains list of object B and the object B contains list of Object C. The object C contains an attribute name that i want to use to filter using java 8.</p>
  
  <p>how to write the code below in java 8 using streams to avoid nested loop :</p>
  
  <pre><code>C c1 = null;
  String name = "name1"
  for (A a: listOfAObjects) {
      for (B b: a.getList()) {
          for (C c: b.getPr()) {
              if (c.getName().equalsIgnoreCase(name)) {
                  c1= c;
                  break;
              }
          }
      }
  }
  </code></pre>