Param[] params = new Param[problem.getParamNames().length];
for (int i = 0; i < params.length; ++i)
params[i] = new Param(problem.getParamNames()[i], convertType(problem.getParamTypes()[i]), i);
Method method = new Method(problem.getMethodName(), convertType(problem.getReturnType()), params);
LanguageTrait trait = LanguageManager.getInstance().getTrait(language);
Testcase[] cases = new Testcase[problem.getTestCases().length];
for (int i = 0; i < cases.length; ++i) {
TestCase tc = problem.getTestCases()[i];
ParamValue[] input = new ParamValue[tc.getInput().length];
for (int j = 0; j < input.length; j++)
input[j] = trait.parseValue(tc.getInput()[j], params[j]);
ParamValue output = trait.parseValue(tc.getOutput(), new Param("expected", method.getReturnType(), params.length));
cases[i] = new Testcase(i, input, output);
if (tc.getAnnotation() != null) {
String ann = getRidOfTopElement(tc.getAnnotation().toXML());
ann = commonTCXMLFixes(ann);