static void addConversions(final PsiElement element,
                             final String prefix,
                             final PsiType itemType,
                             final Consumer<? super LookupElement> result,
                             @Nullable PsiElement qualifier,
                             @NotNull PsiType expectedType) throws IncorrectOperationException {
    final String methodName = getArraysConversionMethod(itemType, expectedType);
    if (methodName == null) return;

    final String qualifierText = ReferenceExpressionCompletionContributor.getQualifierText(qualifier);
    final PsiExpression conversion = createExpression("java.util.Arrays." + methodName + "(" + qualifierText + prefix + ")", element);
    PsiType type = conversion.getType();
    if (type == null || !expectedType.isAssignableFrom(type)) return;

    final String presentable = "Arrays." + methodName + "(" + qualifierText + prefix + ")";
    String[] lookupStrings = {StringUtil.isEmpty(qualifierText) ? presentable : prefix, prefix, presentable, methodName + "(" + prefix + ")"};
    result.consume(new ExpressionLookupItem(conversion, IconManager.getInstance().getPlatformIcon(com.intellij.ui.PlatformIcons.Method), presentable, lookupStrings) {
      @Override
      public void handleInsert(@NotNull InsertionContext context) {
        FeatureUsageTracker.getInstance().triggerFeatureUsed(JavaCompletionFeatures.SECOND_SMART_COMPLETION_ASLIST);

        int startOffset = context.getStartOffset() - qualifierText.length();
        final Project project = element.getProject();
        final String callSpace = getSpace(
          CodeStyle.getLanguageSettings(context.getFile()).SPACE_WITHIN_METHOD_CALL_PARENTHESES);
        final String newText = "java.util.Arrays." + methodName + "(" + callSpace + qualifierText + prefix + callSpace + ")";
        context.getDocument().replaceString(startOffset, context.getTailOffset(), newText);

        context.commitDocument();
        JavaCodeStyleManager.getInstance(project).shortenClassReferences(context.getFile(), startOffset, startOffset + CommonClassNames.JAVA_UTIL_ARRAYS.length());
      }
    });
  }
static void addConversions(final PsiElement element,
                             final String prefix,
                             final PsiType itemType,
                             final Consumer<? super LookupElement> result,
                             @Nullable PsiElement qualifier,
                             @NotNull PsiType expectedType)