public static JClass resolveType(JClassContainer _package, String typeDefinition) {

        try {
            FieldDeclaration fieldDeclaration = (FieldDeclaration) JavaParser.parseBodyDeclaration(typeDefinition + " foo;");
            ClassOrInterfaceType c = (ClassOrInterfaceType) ((ReferenceType) fieldDeclaration.getType()).getType();

            return buildClass(_package, c, 0);
        } catch (ParseException e) {
            throw new GenerationException("Couldn't parse type: " + typeDefinition, e);
        }
    }
@Test
    public void testResolveTypeCanHandleWildcard() {
        final JCodeModel codeModel = new JCodeModel();
        final JClass _class = TypeUtil.resolveType(codeModel.rootPackage(), "java.util.List<?>");

        assertThat(_class.erasure(), equalTo(codeModel.ref(List.class)));
        assertThat(_class.typeParams(), emptyArray());
        assertThat(_class.isParameterized(), is(Boolean.TRUE));
        assertThat(_class.getTypeParameters(), hasSize(1));
        assertThat(_class.getTypeParameters().get(0)._extends(), is(equalTo(codeModel.ref(Object.class))));
    }