void (@NotNull String criteria, @NotNull String exceptionMessage) { try { test(criteria); } catch (MalformedPatternException e) { assertFalse(e.getMessage(), exceptionMessage.isEmpty()); assertTrue(e.getMessage(), e.getMessage().startsWith(exceptionMessage)); } }