@Override
  public void fixUsage() throws IncorrectOperationException {
    final PsiNewExpression newExpression = (PsiNewExpression)getElement();
    if (newExpression != null) {
      final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(newExpression.getProject());

      final StringBuilder buf = new StringBuilder();
      buf.append("new ").append(myNewType.getCanonicalText());
      final PsiArrayInitializerExpression arrayInitializer = newExpression.getArrayInitializer();
      final PsiType newExpressionType = newExpression.getType();
      assert newExpressionType != null;
      if (arrayInitializer != null) {
        buf.append("[]".repeat(newExpressionType.getArrayDimensions()));
        buf.append(arrayInitializer.getText());
      }
      else {
        final PsiExpression[] arrayDimensions = newExpression.getArrayDimensions();
        if (arrayDimensions.length > 0) {
          buf.append("[");
          buf.append(StringUtil.join(arrayDimensions, psiExpression -> psiExpression.getText(), "]["));
          buf.append("]");
          for (int i = 0; i < newExpressionType.getArrayDimensions() - arrayDimensions.length; i++) {
            buf.append("[]");
          }
        } else {
          final PsiExpressionList list = newExpression.getArgumentList();
          if (list != null) {
            buf.append(list.getText());
          }
        }
      }

      newExpression.replace(elementFactory.createExpressionFromText(buf.toString(), newExpression));
    }
  }
@Override
  public void fixUsage()