code: public static <T> Collection<T> take(Iterable<T> self, int num) {
          Collection<T> result = self instanceof Collection ? createSimilarCollection((Collection<T>) self, num < 0 ? 0 : num) : new ArrayList<T>();
          addAll(result, take(self.iterator(), num));
          return result;
      }
docs: Returns the first <code>num</code> elements from the head of this Iterable.
  <pre class="groovyTestCase">
  def strings = [ 'a', 'b', 'c' ]
  assert strings.take( 0 ) == []
  assert strings.take( 2 ) == [ 'a', 'b' ]
  assert strings.take( 5 ) == [ 'a', 'b', 'c' ]
  
  class AbcIterable implements Iterable<String> {
  Iterator<String> iterator() { "abc".iterator() }
  }
  def abc = new AbcIterable()
  assert abc.take(0) == []
  assert abc.take(1) == ['a']
  assert abc.take(3) == ['a', 'b', 'c']
  assert abc.take(5) == ['a', 'b', 'c']
  </pre>
  
  @param self the original Iterable
  @param num  the number of elements to take from this Iterable
  @return a Collection consisting of the first <code>num</code> elements from this Iterable,
  or else all the elements from the Iterable if it has less then <code>num</code> elements.
  @since 1.8.7