private void processUsage(UsageInfo usage, PsiTypeParameter[] original, boolean[] toRemove) throws IncorrectOperationException {
    PsiElementFactory factory = JavaPsiFacade.getElementFactory(myClass.getProject());
    PsiJavaCodeReferenceElement referenceElement = (PsiJavaCodeReferenceElement)usage.getElement();
    assert referenceElement != null : usage;
    PsiSubstitutor usageSubstitutor = determineUsageSubstitutor(referenceElement);

    PsiReferenceParameterList referenceParameterList = referenceElement.getParameterList();
    assert referenceParameterList != null : referenceElement;
    PsiTypeElement[] oldValues = referenceParameterList.getTypeParameterElements();
    if (oldValues.length != original.length) return;
    List<PsiTypeElement> newValues = new ArrayList<>();
    for (final TypeParameterInfo info : myNewSignature) {
      if (info instanceof Existing) {
        newValues.add(oldValues[((Existing)info).getParameterIndex()]);
      }
      else {
        PsiType type = ((New)info).getDefaultValue().getType(myClass.getLBrace(), PsiManager.getInstance(myProject));
        PsiTypeElement newValue = factory.createTypeElement(usageSubstitutor.substitute(type));
        newValues.add(newValue);
      }
    }

    ChangeSignatureUtil.synchronizeList(referenceParameterList, newValues, ReferenceParameterList.INSTANCE, toRemove);
    JavaCodeStyleManager.getInstance(myProject).shortenClassReferences(referenceParameterList);
  }
private void processUsage(UsageInfo usage, PsiTypeParameter[] original, boolean[] toRemove)