void () { Set<FileTypeManagerImpl.FileTypeWithDescriptor> fileTypes = new HashSet<>(myFileTypeManager.getRegisteredFileTypeWithDescriptors()); FileTypeAssocTable<FileTypeManagerImpl.FileTypeWithDescriptor> table = myFileTypeManager.getExtensionMap().copy(); FileTypeManagerImpl.FileTypeWithDescriptor fileType = FileTypeManagerImpl.coreDescriptorFor(ArchiveFileType.INSTANCE); ExactFileNameMatcher matcher = new ExactFileNameMatcher("foo.bar"); table.addAssociation(matcher, fileType); table.removeAssociation(matcher, fileType); WriteAction.run(() -> myFileTypeManager.setPatternsTable(fileTypes, table)); myFileTypeManager.getRemovedMappingTracker().add(matcher, fileType.fileType.getName(), true); Element state = myFileTypeManager.getState(); LOG.debug(JDOMUtil.writeElement(state)); reInitFileTypeManagerComponent(state); List<RemovedMappingTracker.RemovedMapping> mappings = myFileTypeManager.getRemovedMappingTracker().getRemovedMappings(); assertTrue(mappings.get(0).isApproved()); assertEquals(matcher, mappings.get(0).getFileNameMatcher()); assertOneElement(myFileTypeManager.getRemovedMappingTracker().removeIf(mapping -> mapping.getFileNameMatcher().equals(matcher))); }