title: Limit function in Kotlin
body: <p>There is a stream method <code>limit</code> in Java 8:</p>
  
  <pre><code>package com.concretepage.util.stream;
  import java.util.Arrays;
  import java.util.List;
  public class LimitDemo {
      public static void main(String[] args) {
          List&lt;String&gt; list = Arrays.asList("AA","BB","CC","DD","EE");    
          list.stream().limit(3).forEach(s-&gt;System.out.println(s));
      }        
  } 
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>AA
  BB
  CC 
  </code></pre>
  
  <p>What is the name of analog in Kotlin, or how to do it better by another way?</p>