code: public static <T> List<T> asList(Iterable<T> self) {
          if (self instanceof List) {
              return (List<T>) self;
          } else {
              return toList(self);
          }
      }
docs: Converts this Iterable to a List. Returns the original Iterable
  if it is already a List.
  <p>
  Example usage:
  <pre class="groovyTestCase">
  assert new HashSet().asList() instanceof List
  </pre>
  
  @param self an Iterable to be converted into a List
  @return a newly created List if this Iterable is not already a List
  @since 2.2.0