To be clear, an unchecked cast is just a warning, not an error. Your code compiles and
runs fine with it, just it is upset with you because Java can't automatically know
that that cast is a safe thing to. So feel free to suppress the warning, as you are
effectively just telling the compiler "I know this is safe".