title: Executing a method multiple times using a lambda expression in Java
body: <p>What is the easiest and quickest way to execute a code block multiple times using a lambda expression in Java 8?
  For example, a code that will replace the following:</p>
  
  <pre><code>for (int i = 0; i &lt; 20; i ++) {
   doSomething();
  } 
  </code></pre>