Here you can find the source of assertHasInterface(Class> interfaceClass, Class> objectClass)
public static void assertHasInterface(Class<?> interfaceClass, Class<?> objectClass)
//package com.java2s; //License from project: Open Source License public class Main { public static void assertHasInterface(Class<?> interfaceClass, Class<?> objectClass) { Class<?>[] interfaces = objectClass.getInterfaces(); for (Class<?> singleInterface : interfaces) { if (singleInterface.equals(interfaceClass)) { return; }/*from w ww . j ava 2 s . c o m*/ } throw new AssertionError("Class " + objectClass.getName() + " did not implement interface: " + "" + interfaceClass.getName()); } }