@Test
public void testRepeat_negativeNumberThrows() {

  try {
    Patterns.repeat(-1, CharPredicates.ALWAYS);
    fail();
  } catch (IllegalArgumentException e) {
    assertEquals("n < 0", e.getMessage());
  }
}