code: public static <T> Collection<T> takeRight(Iterable<T> self, int num) {
          if (!self.iterator().hasNext() || num <= 0) {
              return self instanceof Collection ? createSimilarCollection((Collection<T>) self, 0) : new ArrayList<T>();
          }
          Collection<T> selfCol = self instanceof Collection ? (Collection<T>) self : toList(self);
          if (selfCol.size() <= num) {
              Collection<T> ret = createSimilarCollection(selfCol, selfCol.size());
              ret.addAll(selfCol);
              return ret;
          }
          Collection<T> ret = createSimilarCollection(selfCol, num);
          ret.addAll(asList((Iterable<T>) selfCol).subList(selfCol.size() - num, selfCol.size()));
          return ret;
      }
docs: Returns the last <code>num</code> elements from the tail of this Iterable.
  <pre class="groovyTestCase">
  def strings = [ 'a', 'b', 'c' ]
  assert strings.takeRight( 0 ) == []
  assert strings.takeRight( 2 ) == [ 'b', 'c' ]
  assert strings.takeRight( 5 ) == [ 'a', 'b', 'c' ]
  
  class AbcIterable implements Iterable<String> {
  Iterator<String> iterator() { "abc".iterator() }
  }
  def abc = new AbcIterable()
  assert abc.takeRight(0) == []
  assert abc.takeRight(1) == ['c']
  assert abc.takeRight(3) == ['a', 'b', 'c']
  assert abc.takeRight(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 last <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 2.4.0