void (@NotNull String before, @NotNull String after, final boolean first) { getCustomCodeStyleSettings().OBJECT_WRAPPING = CommonCodeStyleSettings.DO_NOT_WRAP; myFixture.configureByText(JsonFileType.INSTANCE, before); final PsiElement atCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); final JsonObject jsonObject = PsiTreeUtil.getParentOfType(atCaret, JsonObject.class); assertNotNull(jsonObject); WriteCommandAction.runWriteCommandAction(getProject(), () -> { JsonPsiUtil.addProperty(jsonObject, new JsonElementGenerator(getProject()).createProperty("foo", "null"), first); }); myFixture.checkResult(after); }