test case written for ClassCastException