void () { String s1 = "import java.awt.List;\n" + "class A { List l; }"; String s2 = "class '_ { 'Type:java\\.util\\.List '_Field; }"; assertEquals("No matches for qualified class", 0, findMatchesCount(s1, s2)); String s1_2 = "import java.util.List;\n" + "class A { List l; }"; assertEquals("Matches for qualified class", 1, findMatchesCount(s1_2, s2)); String s3 = "import java.util.ArrayList;\n" + "class A { ArrayList l; }"; assertEquals("Matches for qualified class in hierarchy", 1, findMatchesCount(s3, "class '_ { 'Type:*java\\.util\\.Collection '_Field; }")); String s5 = "import java.util.List;\n" + "class A { { List l = new List(); l.add(\"1\"); } }"; assertEquals("Matches for qualified expr type in hierarchy", 2, findMatchesCount(s5, "'a:[exprtype( *java\\.util\\.Collection )]")); String s6 = "'a:[exprtype( java\\.util\\.List )]"; assertEquals("Matches for qualified expr type", 2, findMatchesCount(s5, s6)); String s5_2 = "import java.awt.List;\n" + "class A { { List l = new List(); l.add(\"1\"); } }"; assertEquals("No matches for qualified expr type", 0, findMatchesCount(s5_2, s6)); String s6_3 = "java.util.List '_a = '_b?;"; assertEquals("Matches for qualified var type in pattern", 1, findMatchesCount(s5, s6_3)); assertEquals("No matches for qualified var type in pattern", 0, findMatchesCount(s5_2, s6_3)); String s7 = "import java.util.List;\n" + "class A extends List { }"; String s8 = "class 'a extends java.util.List {}"; assertEquals("Matches for qualified type in pattern", 1, findMatchesCount(s7, s8)); String s7_2 = "import java.awt.List;\n" + "class A extends List {}"; assertEquals("No matches for qualified type in pattern", 0, findMatchesCount(s7_2, s8)); String s9 = """ class X {{ String.intern("1"); java.util.Collections.sort(null); java.util.Collections.sort(null); }}"""; assertEquals("FQN in class name",1, findMatchesCount(s9, "java.lang.String.'_method ( '_params* )")); }