Only Objects(implicit cast) are added to the non-generic collection. While retrieving, the returned objects are only of type "Object", so you need to explicitly cast them to the required type.
When the cast at Line 4 is removed the compiler would complain about can't assign an "Object" to "Integer"
But with the generic collections this not required
Here no cast is required as this list is asserted to contain only Integer objects.