void () { String nativeExt = myFileTypeManager.getAssociations(NativeFileType.INSTANCE).get(0).toString().replace("*.", ""); assertFalse(StringUtil.isEmpty(nativeExt)); assertEquals(NativeFileType.INSTANCE, myFileTypeManager.getFileTypeByExtension(nativeExt)); FakeFileType newFileType = new FakeFileType() { @Override public boolean isMyFileType(@NotNull VirtualFile file) { return false; } @Override public @NotNull String getName() { return "Foo"; } @Override public @NotNull String getDescription() { return "Foo"; } }; Disposable disposable = Disposer.newDisposable(); try { myFileTypeManager.registerFileType(newFileType, List.of(new ExtensionFileNameMatcher(nativeExt)), disposable, FileTypeManagerImpl.coreIdeaPluginDescriptor()); assertEquals("Foo", myFileTypeManager.getFileTypeByFileName("foo." + nativeExt).getName()); } finally { Disposer.dispose(disposable); } }