final JavaType typeToImport) {
Validate.notNull(targetType, "Target type is required");
Validate.notNull(imports, "Compilation unit imports required");
Validate.notNull(typeToImport, "Java type to import is required");
final ClassOrInterfaceType cit = getClassOrInterfaceType(importTypeIfRequired(
targetType, imports, typeToImport));
// Add any type arguments presented for the return type
if (typeToImport.getParameters().size() > 0) {
final List<Type> typeArgs = new ArrayList<Type>();
cit.setTypeArgs(typeArgs);
for (final JavaType parameter : typeToImport.getParameters()) {
typeArgs.add(JavaParserUtils.importParametersForType(
targetType, imports, parameter));
}
}