void () { final PsiFile psiFile = myFixture.configureByFile("bar.xml"); final PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(psiFile); assertNotNull(propertiesFile); WriteCommandAction.runWriteCommandAction(getProject(), () -> { propertiesFile.addProperty("d", "vvv"); propertiesFile.addProperty("a", "vvv"); propertiesFile.addProperty("l", "vvv"); propertiesFile.addProperty("v", "vvv"); }); assertTrue(propertiesFile.isAlphaSorted()); assertTrue(PropertiesImplUtil.getPropertiesFile(psiFile).isAlphaSorted()); }