@Test public void test_mismatch_description() { final Matcher<Object> isThrowable = is(throwable()); final Object o = "string"; assertThat("Matching fails", isThrowable.matches(o), is(false)); StringDescription desc = new StringDescription(); isThrowable.describeMismatch(o, desc); assertThat(desc.toString(), is("\"string\" is a java.lang.String")); }
@Factory public static InstanceOf<Throwable> throwable() { return throwable(Throwable.class); }
IsThrowable { @Factory public static InstanceOf<Throwable> throwable() { return throwable(Throwable.class); } }
IsThrowable { @Factory public static InstanceOf<Throwable> throwable() { return throwable(Throwable.class); }  }
IsThrowable { @Factory public static InstanceOf<Throwable> throwable() { return throwable(Throwable.class); }  @Factory static InstanceOf<Throwable> throwable(); @Factory static InstanceOf<T> throwable(Class<T> clazz); @Factory static Matcher<Object> throwable(String message); @Factory static Matcher<Object> throwable(Class<? extends Throwable> clazz, String message); @Factory static Matcher<Object> throwable(Matcher<? super Throwable> matcher); @Factory static Matcher<Object> throwable(Class<T> clazz, Matcher<? super T> matcher); @Factory @SuppressWarnings("unchecked") static Matcher<Object> throwable(Class<T> clazz, String message, Matcher<? super T> matcher); @Factory static InstanceOf<Exception> exception(); @Factory static InstanceOf<T> exception(Class<T> clazz); @Factory static Matcher<Object> exception(String message); @Factory static Matcher<Object> exception(Matcher<? super Exception> matcher); @Factory static Matcher<Object> exception(Class<? extends Exception> clazz, String message); @Factory static Matcher<Object> exception(Class<T> clazz, Matcher<? super T> matcher); @Factory static Matcher<Object> exception(Class<T> clazz, String message, Matcher<? super T> matcher); }
IsThrowable { @Factory public static InstanceOf<Throwable> throwable() { return throwable(Throwable.class); }  @Factory static InstanceOf<Throwable> throwable(); @Factory static InstanceOf<T> throwable(Class<T> clazz); @Factory static Matcher<Object> throwable(String message); @Factory static Matcher<Object> throwable(Class<? extends Throwable> clazz, String message); @Factory static Matcher<Object> throwable(Matcher<? super Throwable> matcher); @Factory static Matcher<Object> throwable(Class<T> clazz, Matcher<? super T> matcher); @Factory @SuppressWarnings("unchecked") static Matcher<Object> throwable(Class<T> clazz, String message, Matcher<? super T> matcher); @Factory static InstanceOf<Exception> exception(); @Factory static InstanceOf<T> exception(Class<T> clazz); @Factory static Matcher<Object> exception(String message); @Factory static Matcher<Object> exception(Matcher<? super Exception> matcher); @Factory static Matcher<Object> exception(Class<? extends Exception> clazz, String message); @Factory static Matcher<Object> exception(Class<T> clazz, Matcher<? super T> matcher); @Factory static Matcher<Object> exception(Class<T> clazz, String message, Matcher<? super T> matcher);  }