@Test
public void testShorter() {

  assertEquals(0, Patterns.shorter(Patterns.ALWAYS, Patterns.NEVER).match("", 0, 0));
  assertEquals(MISMATCH, Patterns.shorter(Patterns.NEVER, Patterns.NEVER).match("", 0, 0));
  assertEquals(0, Patterns.shorter(Patterns.ALWAYS, Patterns.ALWAYS).match("", 0, 0));
  assertEquals(1, Patterns.shorter(Patterns.hasAtLeast(1), Patterns.NEVER).match("a", 0, 1));
  assertEquals(0, Patterns.shorter(Patterns.hasAtLeast(1), Patterns.ALWAYS).match("a", 0, 1));
  assertEquals(1, Patterns.shorter(Patterns.hasAtLeast(1), Patterns.hasExact(2)).match("ab", 0, 2));
}