Here you can find the source of printCollection(Collection collection)
public static void printCollection(Collection collection)
//package com.java2s; //License from project: Open Source License import java.util.Collection; import java.util.Iterator; public class Main { public static void printCollection(Collection collection) { Iterator itr = collection.iterator(); System.out.println("-----Printing Collection-----"); while (itr.hasNext()) { System.out.println(itr.next()); }//from ww w. j a va 2 s .co m System.out.println("-----End Of Collection-----"); } }