String (PsiElement myNewExpression, PsiArrayInitializerExpression myInitializer) { final String newText = myNewExpression.getText(); final int initializerIdx = newText.indexOf(myInitializer.getText()); if (initializerIdx != -1) { return newText.substring(0, initializerIdx).trim(); } return newText; }