public TypeReference replace(final TypeReference target, final Map<? extends TypeReference, ? extends TypeReference> mappings) { final Function2<TypeReference, Map.Entry<? extends TypeReference, ? extends TypeReference>, TypeReference> _function = (TypeReference result, Map.Entry<? extends TypeReference, ? extends TypeReference> mapping) -> { return this.replace(result, mapping.getKey(), mapping.getValue()); }; return IterableExtensions.fold(mappings.entrySet(), target, _function); }
if (_not) { final Function1<TypeReference, TypeReference> _function = (TypeReference it) -> { return this.replace(it, oldType, newType); }; return this.context.newTypeReference(target.getType(), ((TypeReference[])Conversions.unwrapArray(ListExtensions.<TypeReference, TypeReference>map(target.getActualTypeArguments(), _function), TypeReference.class))); boolean _notEquals = (!Objects.equal(_upperBound, _object)); if (_notEquals) { return this.context.newWildcardTypeReference(this.replace(target.getUpperBound(), oldType, newType)); } else { boolean _isAnyType = target.getLowerBound().isAnyType(); boolean _not_1 = (!_isAnyType); if (_not_1) { return this.context.newWildcardTypeReferenceWithLowerBound(this.replace(target.getLowerBound(), oldType, newType)); return this.context.newArrayTypeReference(this.replace(target.getArrayComponentType(), oldType, newType));
typeParameterMappings.put(this.context.newTypeReference(param.getDeclaration()), this.context.newTypeReference(copy)); final Function1<TypeReference, TypeReference> _function_2 = (TypeReference it) -> { return this.replace(it, typeParameterMappings); }; copy.setUpperBounds(IterableExtensions.map(copy.getUpperBounds(), _function_2)); resolvedMethod.getResolvedTypeParameters().forEach(_function_1); final Function1<TypeReference, TypeReference> _function_2 = (TypeReference it) -> { return this.replace(it, typeParameterMappings); }; impl.setExceptions(((TypeReference[])Conversions.unwrapArray(IterableExtensions.map(resolvedMethod.getResolvedExceptionTypes(), _function_2), TypeReference.class))); impl.setVarArgs(declaration.isVarArgs()); impl.setReturnType(this.replace(resolvedMethod.getResolvedReturnType(), typeParameterMappings)); final Consumer<ResolvedParameter> _function_3 = (ResolvedParameter p) -> { impl.addParameter(p.getDeclaration().getSimpleName(), this.replace(p.getResolvedType(), typeParameterMappings)); }; resolvedMethod.getResolvedParameters().forEach(_function_3);