The following snippet makes sense yet when I run this against my unit test.. I get a ClassCastException (Object can\'t be cast to String) on the line marked with \'>>>>\'.
You should not create your array using new Object[]. You should use Array.newInstance(Class clazz, int length) instead.
Array.newInstance(Class clazz, int length)