void () { String source = """ interface XYZ { default void m() { System.out.println(); } void f(); void g(); } interface ABC { void m(); } interface KLM { } interface I { void m(); }"""; String pattern1 = "interface '_Class { default '_ReturnType 'MethodName('_ParameterType '_Parameter*);}"; assertEquals("should find default method", 1, findMatchesCount(source, pattern1)); String pattern2 = "interface 'Class { default '_ReturnType '_MethodName{0,0}('_ParameterType '_Parameter*);}"; assertEquals("should find interface without default methods", 3, findMatchesCount(source, pattern2)); String pattern3 = "default '_ReturnType 'MethodName('_ParameterType '_Parameter*);"; assertEquals("find naked default method", 1, findMatchesCount(source, pattern3)); }