private ProducedType obtainTypeParameterBound(Module moduleScope, TypeMirror type, Scope scope, Set<TypeDeclaration> rawDeclarationsSeen) {
// type variables are never mapped
if(type.getKind() == TypeKind.TYPEVAR){
TypeParameterMirror typeParameter = type.getTypeParameter();
if(!typeParameter.getBounds().isEmpty()){
IntersectionType it = new IntersectionType(getUnitForModule(moduleScope));
for(TypeMirror bound : typeParameter.getBounds()){
ProducedType boundModel = obtainTypeParameterBound(moduleScope, bound, scope, rawDeclarationsSeen);
it.getSatisfiedTypes().add(boundModel);
}
return it.getType();
}else
// no bound is Object
return typeFactory.getObjectDeclaration().getType();
}else{
TypeMirror mappedType = applyTypeMapping(type, TypeLocation.TYPE_PARAM);