Is there a nicer way to write in jUnit
String x = \"foo bar\"; Assert.assertTrue(x.contains(\"foo\"));
Another variant is
Assert.assertThat(actual, new Matches(expectedRegex));
Moreover in org.mockito.internal.matchers there are some other interesting matchers, like StartWith, Contains etc.
org.mockito.internal.matchers
StartWith
Contains