public void setPattern(String name, Pattern pattern) {
    assert pattern != null : "Pattern cannot be null";
    set(name, pattern.pattern());
  }
@Test
  public void testSetPattern() {
    Pattern testPattern = Pattern.compile("a+b");
    Configuration configuration = new Configuration();
    configuration.setPattern("testPattern", testPattern);
    assertEquals(testPattern.pattern(),
        configuration.getPattern("testPattern", Pattern.compile("")).pattern());
  }