void (String blockText, int from, int to, TextRange expectedRange) { PsiElementFactory factory = JavaPsiFacade.getElementFactory(getProject()); PsiLiteralExpression textBlock = (PsiLiteralExpression)factory.createExpressionFromText(blockText, null); assertTrue(textBlock.isTextBlock()); int indent = PsiLiteralUtil.getTextBlockIndent(textBlock); assertTrue(indent >= 0); TextRange actualRange = PsiLiteralUtil.mapBackTextBlockRange(textBlock.getText(), from, to, indent); assertEquals(expectedRange, actualRange); }