Listing B
static boolean checkName(Collection<String> employeeNameList, String name) {
       for (Iterator i = employeeNamList.iterator(); i.hasNext(); ) {
              
         if(i.next().equals(name)){
                   return true;
                        //print employee name here ......
         }
       }
       return false;
}