Update the test code to support java generic.