void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { String text = element.getText(); int[] positions; if (element instanceof PsiLiteralExpression literal) { positions = findPositions(text, literal.isTextBlock()); } else if (element instanceof PsiFragment fragment) { positions = findPositions(text, fragment.isTextBlock()); } else { return; } String newText = IntStreamEx.of(positions) .takeWhile(pos -> pos < text.length() - 2) .boxed() .prepend(-2) .append(text.length()) .pairMap((start, end) -> text.substring(start + 2, end)) .joining(" "); if (element instanceof PsiFragment) { PsiReplacementUtil.replaceFragment((PsiFragment)element, newText); } else { element.replace(JavaPsiFacade.getElementFactory(project).createExpressionFromText(newText, null)); } }