void (String word, VirtualFile file) { final SpellCheckerManager manager = SpellCheckerManager.getInstance(getProject()); try { assertTrue(manager.hasProblem(word)); CommandProcessor.getInstance().executeCommand(getProject(), () -> manager .acceptWordAsCorrect$intellij_spellchecker(word, file, getProject(), DictionaryLevel.PROJECT), getName(), null); assertFalse(manager.hasProblem(word)); } finally { manager.updateUserDictionary(Collections.emptyList()); } }