Java Iterable to Collection iterableToCollection(Iterable iter, Collection list)

Here you can find the source of iterableToCollection(Iterable iter, Collection list)

Description

iterable To Collection

License

Open Source License

Declaration

private static <E> void iterableToCollection(Iterable<? extends E> iter, Collection<E> list) 

Method Source Code

//package com.java2s;

import java.util.Collection;

public class Main {
    private static <E> void iterableToCollection(Iterable<? extends E> iter, Collection<E> list) {
        if (iter == null) {
            return;
        }//from ww  w  .  j  a  va  2s .c o  m

        for (E element : iter) {
            list.add(element);
        }
    }
}

Related

  1. iterableToCollection(Iterable iterable)
  2. iterableToString(Iterable collection, String sep)
  3. iterableToString(String separator, Iterable collection)