PatternUtils { public static boolean isContainsMatch(String expression) { return expression != null && expression.startsWith("%") && expression.endsWith("%"); }  static boolean isExactMatch(String expression); static boolean isContainsMatch(String expression); static boolean isRegex(String expression); static String removeFirstAndLastChars(String expression);  }
@Test public void testIsContainsMatch() { assertThat(isContainsMatch("%something%"), is(true)); assertThat(isContainsMatch("anything"), is(false)); }