void () { String s1 = "class X {{ String[] argv; }}"; String s2 = "class X {{ String argv; }}"; assertEquals("Find array types", 0, findMatchesCount(s1, "String argv;")); assertEquals("Find array types, 2", 0, findMatchesCount(s2, "String[] argv;")); assertEquals("Find array types, 3", 0, findMatchesCount(s2, "'T[] argv;")); assertEquals("Find array types, 3", 1, findMatchesCount(s1, "'T:*Object [] argv;")); String s11 = """ class A { void main(String[] argv); void main(String argv[]); void main(String argv); }"""; assertEquals("Find array covariant types", 2, findMatchesCount(s11, "'_t:[regex( *Object\\[\\] ) ] '_t2;")); assertEquals("Find array covariant types, 2", 2, findMatchesCount(s11, "'_t:[regex( *Object ) ] '_t2 [];")); assertEquals("Find array covariant types, 3", 1, findMatchesCount(s11, "'_t:[regex( *Object ) ] '_t2;")); }