title: How to convert nested loops to a one-liner?
body: <p>Is that possible to convert below for loops to a one-liner using the <code>stream</code> api?</p>
  
  <pre><code>List&lt;QuestionAnswer&gt; questionAnswerCombinations = new ArrayList&lt;&gt;();
  
  for (Question question : questions) {
      for (String answer : question.getAnswers()) {
          questionAnswerCombinations.add(new QuestionAnswer(question.getLabel(), answer ));
      }
  }
  </code></pre>
  
  <p>I though of using <code>flatMap</code> but I loose the <code>question</code> when I do that. </p>
  
  <p>What is the correct way of converting this nesting loops to a one-liner?</p>
  
  <p><strong>Note:</strong> I can add the data structure of <code>Question</code> class if needed, but there is no complication other than what is inferred from the usage.</p>
  
  <p><strong>Update:</strong> What I'm trying to do is basically collect all question+answer combinations into another list. As in:</p>
  
  <pre><code>Question 1
  -Answer a
  -Answer b
  -Answer c
  Question 2
  -Answer x
  -Answer y
  
  Question 1, Answer a
  Question 1, Answer b
  Question 1, Answer c
  Question 2, Answer x
  Question 2, Answer y
  </code></pre>