public void test_hasTransparentBounds() {
    String testPattern = "abb";
    String testString = "ab\nb";
    Pattern pat = Pattern.compile(testPattern);
    Matcher mat = pat.matcher(testString);

    assertFalse("Matcher uses opaque bounds by default", mat.hasTransparentBounds());

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

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