The following code snippet should highlight the problem.
Collection<Manager> managers=new Collection<Manager>;
Collection<Employee> employees=managers;
employees.add(new Janitor());
// Writing it out with iterator instead of enhanced for-loop
for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {
Manager manager = it.next(); // ! Here we'll crash with ClassCastException !
System.out.println(manager.manages());
}
So, it is not the employees list that is the problem - it is that the managers list can now have other stuff shoved into it.
You can force it through by casting if you want - but then you probably buy yourself trouble later.
Java's generics guarantee that you will NEVER get such a ClassCastException anywhere IFF you have not made any such errors or warnings.
As a side-note, the exact same situation is actually possible/legal with arrays, and as such can give you ArrayStoreExceptions where you would not expect it.
Manager[] managers = new Manager[20];
Employee[] employees = managers; // No error or warning
employees[15] = new Janitor(); // gives ArrayStoreException