Don't use casts unless necessary.

In this case, using the Collection type still does what is needed.
Couple of minor changes to the Util class.

Some control structures are unnecessary, and some checks aren't checking for an empty list.