what if another exception is thrown? Maybe catching and asserting ClassCastException is better.