void (@NotNull String text, int... spacesForLine) { configureFromFileText("x.java", text); Document document = PsiDocumentManager.getInstance(getProject()).getDocument(getFile()); FormattingModelBuilder builder = LanguageFormatting.INSTANCE.forContext(getFile()); Assert.assertNotNull(document); Assert.assertNotNull(builder); FormattingModel model = builder.createModel(FormattingContext.create(getFile(), CodeStyle.getSettings(getProject()))); Block block = model.getRootBlock(); List<LineIndentInfo> list = new FormatterBasedLineIndentInfoBuilder(document, block, null).build(); Assert.assertEquals(list.size(), spacesForLine.length); for (int i = 0; i < spacesForLine.length; i++) { int indentSize = list.get(i).getIndentSize(); Assert.assertEquals("Mismatch on line " + i, spacesForLine[i], indentSize); } }