@Test
public void testParse() {

  if (correct) {
    assertEquals(pattern, new Parser().parse(pattern).toString());
  } else {
    try {
      new Parser().parse(pattern);
      fail("Expecting an exception for pattern: " + pattern);
    } catch (IllegalArgumentException ignore) {
      // expected
    }
  }
}