protected void checkGenericTypeNames(Class<?> rawType, TypeName node) {
            // Check that generic types are valid java classes
            TypeName[] genericTypes = node.getGenericTypes();
            if (genericTypes != null) {
                java.lang.reflect.Type[] arguments =
                    new java.lang.reflect.Type[genericTypes.length];

                for (int i = 0; i < genericTypes.length; i++) {
                    this.check(genericTypes[i]);
                    Type result = genericTypes[i].getType();
                    if (result != null) {
                        arguments[i] = result.getGenericClass();
                    } else {
                        arguments[i] = Object.class;
                    }
                }

                node.setType(new Type(rawType, new ParameterizedTypeImpl(rawType, arguments)));
            }
            else {
                node.setType(new Type(rawType));
            }
        }