public PsiSubstitutor recapture(PsiSubstitutor substitutor) {
    PsiSubstitutor result = PsiSubstitutor.EMPTY;
    for (Map.Entry<PsiTypeParameter, PsiType> entry : substitutor.getSubstitutionMap().entrySet()) {
      PsiType value = entry.getValue();
      result = result.put(entry.getKey(), value == null ? null : mapType(value));
    }
    return result;
  }
public PsiSubstitutor recapture(PsiSubstitutor substitutor)