@@ -0,0 +1,1454 @@
+package ca.fragag.testhelpers;%0A%0Aimport java.util.Objects;%0A%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.DiagnosingMatcher;%0Aimport org.hamcrest.Matcher;%0A%0A/**%0A * Matches an object whose runtime type is exactly some specific type.%0A *%0A * @param %3CT%3E%0A *            the type of the matched object%0A *%0A * @author Francis Gagn%C3%A9%0A */%0Apublic class HasType%3CT%3E extends DiagnosingMatcher%3CT%3E %7B%0A%0A    /**%0A     * Returns a matcher that matches an object whose runtime type is exactly some specific type.%0A     *%0A     * @param type%0A     *            the expected type%0A     * @return the matcher%0A     */%0A    public static %3CT%3E Matcher%3CT%3E hasType(Class%3C?%3E type) %7B%0A        return new HasType%3C%3E(type);%0A    %7D%0A%0A    private final Class%3C?%3E type;%0A%0A    /**%0A     * Initializes a new HasType.%0A     *%0A     * @param type%0A     *            the expected type%0A     */%0A    public HasType(Class%3C?%3E type) %7B%0A        if (type == null) %7B%0A            throw new NullPointerException(%22type%22);%0A        %7D%0A%0A        this.type = type;%0A    %7D%0A%0A    @Override%0A    public void describeTo(Description description) %7B%0A        description.appendText(%22an object with type %22).appendValue(this.type);%0A    %7D%0A%0A    @Override%0A    protected boolean matches(Object item, Description mismatchDescription) %7B%0A        if (!Objects.equals(item.getClass(), this.type)) %7B%0A            mismatchDescription.appendText(%22has type %22).appendValue(item.getClass());%0A            return false;%0A        %7D%0A%0A        return true;%0A    %7D%0A%0A%7D%0A

Add the HasType matcher