void () { String myWeirdExtension = "my_weird_extension"; Disposable disposable = Disposer.newDisposable(); try { FileType myType = createFakeType("myType", "myDisplayName", "myDescription", myWeirdExtension, disposable); myFileTypeManager.getRemovedMappingTracker().add(new ExtensionFileNameMatcher(myWeirdExtension), myType.getName(), true); Element stateWithRemovedMapping = myFileTypeManager.getState(); WriteAction.run(() -> myFileTypeManager.associateExtension(PlainTextFileType.INSTANCE, myWeirdExtension)); // now, ordinarily we'd get conflict, but thanks to externalized removed mapping tracker, we won't reInitFileTypeManagerComponent(stateWithRemovedMapping); assertEmpty(myConflicts); assertEquals(PlainTextFileType.INSTANCE, myFileTypeManager.getFileTypeByExtension(myWeirdExtension)); } finally { Disposer.dispose(disposable); WriteAction.run(() -> myFileTypeManager.removeAssociatedExtension(PlainTextFileType.INSTANCE, myWeirdExtension)); } }