void () { String source = ""; try { findMatchesCount(source, "/*$A$a*/"); fail("malformed pattern warning expected"); } catch (MalformedPatternException ignored) {} try { findMatchesCount(source, "class $A$Visitor {}"); fail("malformed pattern warning expected"); } catch (MalformedPatternException ignored) { } try { String pattern3 = """ class $Class$ { class $n$$FieldType$ $FieldName$ = $Init$; }"""; findMatchesCount(source, pattern3); fail("malformed pattern warning expected"); } catch (MalformedPatternException ignored) {} try { findMatchesCount(source, "@SuppressWarnings(\\\"NONE\\\") @Deprecated"); fail("malformed pattern warning expected"); } catch (MalformedPatternException ignored) {} }