Matchers.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:Reer 作者:
/**
 * A reimplementation of hamcrest's isA() but without the broken generics.
 */
@Factory
public static Matcher<Object> isA(final Class<?> type) {
    return new BaseMatcher<Object>() {
        public boolean matches(Object item) {
            return type.isInstance(item);
        }

        public void describeTo(Description description) {
            description.appendText("instanceof ").appendValue(type);
        }
    };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号