### Question:
ComplianceMatcher extends TypeSafeMatcher<T> { @Factory public static <T> Matcher<T> compliantTo(Testable testable) { return new ComplianceMatcher<>(testable); } ComplianceMatcher(Testable testable); @Override void describeTo(Description description); @Factory static Matcher<T> compliantTo(Testable testable);  }### Answer:
@Test public void compliantToForHtmlPageAgainstRuleSet() throws Exception { assertThat(TestPage.asHtmlPage(), is(compliantTo(satisfiedRuleSet))); assertThat(TestPage.asHtmlPage(), is(not(compliantTo(unsatisfiedRuleSet)))); }
@Test public void compliantToForHtmlPageAgainstRule() throws Exception { assertThat(TestPage.asHtmlPage(), is(compliantTo(satisfiedRule))); assertThat(TestPage.asHtmlPage(), is(not(compliantTo(unsatisfiedRule)))); }
@Test public void compliantToForStringAgainstRuleSet() throws Exception { assertThat(TestPage.asString(), is(compliantTo(satisfiedRuleSet))); assertThat(TestPage.asString(), is(not(compliantTo(unsatisfiedRuleSet)))); }
@Test public void compliantToForStringAgainstRule() throws Exception { assertThat(TestPage.asString(), is(compliantTo(satisfiedRule))); assertThat(TestPage.asString(), is(not(compliantTo(unsatisfiedRule)))); }
@Test public void compliantToForReaderAgainstRuleSet() throws Exception { assertThat(TestPage.asReader(), is(compliantTo(satisfiedRuleSet))); assertThat(TestPage.asReader(), is(not(compliantTo(unsatisfiedRuleSet)))); }
@Test public void compliantToForReaderAgainstRule() throws Exception { assertThat(TestPage.asReader(), is(compliantTo(satisfiedRule))); assertThat(TestPage.asReader(), is(not(compliantTo(unsatisfiedRule)))); }
@Test public void compliantToForURLAgainstRuleSet() throws Exception { assertThat(TestPage.asURL(), is(compliantTo(satisfiedRuleSet))); assertThat(TestPage.asURL(), is(not(compliantTo(unsatisfiedRuleSet)))); }
@Test public void compliantToForURLAgainstRule() throws Exception { assertThat(TestPage.asURL(), is(compliantTo(satisfiedRule))); assertThat(TestPage.asURL(), is(not(compliantTo(unsatisfiedRule)))); }
@Test public void compliantToForInputStreamAgainstRuleSet() throws Exception { assertThat(TestPage.asInputStream(), is(compliantTo(satisfiedRuleSet))); assertThat(TestPage.asInputStream(), is(not(compliantTo(unsatisfiedRuleSet)))); }
@Test public void compliantToForInputStreamAgainstRule() throws Exception { assertThat(TestPage.asInputStream(), is(compliantTo(satisfiedRule))); assertThat(TestPage.asInputStream(), is(not(compliantTo(unsatisfiedRule)))); }
@Test public void compliantToForObjectAgainstRuleSet() throws Exception { try { assertThat(new Object(), is(compliantTo(satisfiedRuleSet))); fail(); } catch (UnsupportedOperationException e) { } try { assertThat(new Object(), is(not(compliantTo(unsatisfiedRuleSet)))); fail(); } catch (UnsupportedOperationException e) { } }
@Test public void compliantToForObjectPageAgainstRule() throws Exception { try { assertThat(new Object(), is(compliantTo(satisfiedRule))); fail(); } catch (UnsupportedOperationException e) { } try { assertThat(new Object(), is(not(compliantTo(unsatisfiedRule)))); fail(); } catch (UnsupportedOperationException e) { } }
@Test(expected = IllegalArgumentException.class) public void callToDescribeMismatchDoesNotThrowNullPointerException() throws Exception { compliantTo(satisfiedRuleSet).describeMismatch(TestPage.asHtmlPage(), new StringDescription()); }