void () { configureFromFileText("x.txt", "abc"); assertEquals(StandardCharsets.UTF_8, getVFile().getCharset()); assertNull(getVFile().getBOM()); executeAction("AddBom", getEditor(), getProject()); assertEquals(StandardCharsets.UTF_8, getVFile().getCharset()); assertOrderedEquals(CharsetToolkit.UTF8_BOM, getVFile().getBOM()); assertThrows(AssertionError.class, () -> executeAction("AddBom", getEditor(), getProject())); assertOrderedEquals(CharsetToolkit.UTF8_BOM, getVFile().getBOM()); }