79101959

Date: 2024-10-18 11:55:39
Score: 2
Natty:
Report link

This asserts that "xyz" occurrs n times anywhere in myString.

Matcher matcher = Pattern.compile("xyz").matcher(myString);
assertThat(matcher.results().count()).isEqualTo(n);
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Samuel