void () { FileType XML = StdFileTypes.XML; FileTypeAssocTable<FileType> associations = new FileTypeAssocTable<>(); associations.addAssociation(FileTypeManager.parseFromString("*.java"), ArchiveFileType.INSTANCE); associations.addAssociation(FileTypeManager.parseFromString("*.xyz"), XML); associations.addAssociation(FileTypeManager.parseFromString("SomeSpecial*.java"), XML); // patterns should have precedence over extensions assertEquals(XML, associations.findAssociatedFileType("sample.xyz")); assertEquals(XML, associations.findAssociatedFileType("SomeSpecialFile.java")); checkNotAssociated(XML, "java", associations); checkNotAssociated(XML, "iws", associations); }