public void test_hasAnchoringBounds() {
    String testPattern = "abb";
    String testString = "abb";
    Pattern pat = Pattern.compile(testPattern);
    Matcher mat = pat.matcher(testString);

    assertTrue("Matcher uses anchoring bound by default", mat.hasAnchoringBounds());

    Matcher mu = mat.useAnchoringBounds(true);
    assertTrue("Incorrect value of anchoring bounds", mu.hasAnchoringBounds());

    mu = mat.useAnchoringBounds(false);
    assertFalse("Incorrect value of anchoring bounds", mu.hasAnchoringBounds());
  }