title: Java 8 stream variable used in lambda should be final or effectively final
body: <p>This question is already asked. But today I found something odd. For the following code:-</p>
  
  <pre><code>public static List&lt;EsbBucketInstanceDefinition&gt; convertBucketDefinitionList(List&lt;BucketInstanceDefinitionV1&gt; bucketInstanceDefinitionV1List) {
      List&lt;EsbBucketInstanceDefinition&gt; response = new ArrayList&lt;&gt;();
      List&lt;EsbBucketInstanceDefinition&gt; finalResponse = new ArrayList&lt;&gt;();
      bucketInstanceDefinitionV1List.stream().forEach(e -&gt; {
          EsbBucketInstanceDefinition esbBucketInstanceDefinition = new EsbBucketInstanceDefinition();
          esbBucketInstanceDefinition.setInstanceType(e.getInstanceType());
          esbBucketInstanceDefinition.setReportingGroup(e.getReportingGroup());
          esbBucketInstanceDefinition.setSliceVolume(e.getSliceVolume());
          esbBucketInstanceDefinition.setCounterName(e.getCounterName());
          esbBucketInstanceDefinition.setSubscriberGroupId(e.getSubscriberGroupId());
          // response.add(esbBucketInstanceDefinition); compiler error variable used in lambda should be final or effective final 
          finalResponse.add(esbBucketInstanceDefinition);
      });
      return finalResponse;
  }
  </code></pre>
  
  <p>For this works fine. Looks like only variable name finalResponse is working. How and why? Is it valid to do?  </p>