@Test public void whenValidExpressionQueryIsBuilt() { assertThat(RegexCriteriaValidator.validate(EXPRESSION), is(EXPRESSION)); }
public static String validate(final String expression) { try { new RegExp(expression); } catch (IllegalArgumentException e) { throw new InvalidExpressionException( format("Invalid regular expression pattern: %s", e.getMessage())); } return expression; }
RegexCriteriaValidator { public static String validate(final String expression) { try { new RegExp(expression); } catch (IllegalArgumentException e) { throw new InvalidExpressionException( format("Invalid regular expression pattern: %s", e.getMessage())); } return expression; } }
RegexCriteriaValidator { public static String validate(final String expression) { try { new RegExp(expression); } catch (IllegalArgumentException e) { throw new InvalidExpressionException( format("Invalid regular expression pattern: %s", e.getMessage())); } return expression; } private  RegexCriteriaValidator(); }
RegexCriteriaValidator { public static String validate(final String expression) { try { new RegExp(expression); } catch (IllegalArgumentException e) { throw new InvalidExpressionException( format("Invalid regular expression pattern: %s", e.getMessage())); } return expression; } private  RegexCriteriaValidator(); static String validate(final String expression); }
RegexCriteriaValidator { public static String validate(final String expression) { try { new RegExp(expression); } catch (IllegalArgumentException e) { throw new InvalidExpressionException( format("Invalid regular expression pattern: %s", e.getMessage())); } return expression; } private  RegexCriteriaValidator(); static String validate(final String expression);  }