@Test public void testImplementsInterface() { Assert.assertTrue(ReflectionUtils.implementsInterface(ArrayList.class, List.class)); Assert.assertTrue(ReflectionUtils.implementsInterface(ArrayList.class, Collection.class)); Assert.assertFalse(ReflectionUtils.implementsInterface(Set.class, List.class)); }
public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); }
ReflectionUtils { public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); } }
ReflectionUtils { public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); }  }
ReflectionUtils { public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); }  static Field[] getDeclaredAndInheritedFields(final Class type, final boolean returnFinalFields); static List<Method> getDeclaredAndInheritedMethods(final Class type); static List<Field> getValidFields(final Field[] fields, final boolean returnFinalFields); static boolean implementsInterface(final Class type, final Class interfaceClass); static boolean isPropertyType(final Type type); static boolean isPropertyType(final Class type); static boolean isPrimitiveLike(final Class type); static Class getParameterizedClass(final Field field); static Class getParameterizedClass(final Field field, final int index); static Type getParameterizedType(final Field field, final int index); static Class getTypeArgumentOfParameterizedClass(final Field field, final int index, final int typeIndex); static Class getParameterizedClass(final Class c); static Class getParameterizedClass(final Class c, final int index); static boolean isFieldParameterizedWithClass(final Field field, final Class c); static boolean isFieldParameterizedWithPropertyType(final Field field); static T getAnnotation(final Class c, final Class<T> annClass); static ArrayList<T> getAnnotations(final Class c, final Class<T> annClass); static Embedded getClassEmbeddedAnnotation(final Class c); static Entity getClassEntityAnnotation(final Class c); static Set<Class<?>> getFromDirectory(final File directory, final String packageName); static Set<Class<?>> getFromJARFile(final String jar, final String packageName); static Set<Class<?>> getClasses(final String packageName); static Set<Class<?>> getClasses(final ClassLoader loader, final String packageName); static ArrayList iterToList(Iterable it); static Object convertToArray(final Class type, final List<?> values); static Class<?> getClass(Type type); static List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass); static Class<?> getTypeArgument(Class<? extends T> clazz, TypeVariable<? extends GenericDeclaration> tv); }
ReflectionUtils { public static boolean implementsInterface(final Class type, final Class interfaceClass) { return interfaceClass.isAssignableFrom(type); }  static Field[] getDeclaredAndInheritedFields(final Class type, final boolean returnFinalFields); static List<Method> getDeclaredAndInheritedMethods(final Class type); static List<Field> getValidFields(final Field[] fields, final boolean returnFinalFields); static boolean implementsInterface(final Class type, final Class interfaceClass); static boolean isPropertyType(final Type type); static boolean isPropertyType(final Class type); static boolean isPrimitiveLike(final Class type); static Class getParameterizedClass(final Field field); static Class getParameterizedClass(final Field field, final int index); static Type getParameterizedType(final Field field, final int index); static Class getTypeArgumentOfParameterizedClass(final Field field, final int index, final int typeIndex); static Class getParameterizedClass(final Class c); static Class getParameterizedClass(final Class c, final int index); static boolean isFieldParameterizedWithClass(final Field field, final Class c); static boolean isFieldParameterizedWithPropertyType(final Field field); static T getAnnotation(final Class c, final Class<T> annClass); static ArrayList<T> getAnnotations(final Class c, final Class<T> annClass); static Embedded getClassEmbeddedAnnotation(final Class c); static Entity getClassEntityAnnotation(final Class c); static Set<Class<?>> getFromDirectory(final File directory, final String packageName); static Set<Class<?>> getFromJARFile(final String jar, final String packageName); static Set<Class<?>> getClasses(final String packageName); static Set<Class<?>> getClasses(final ClassLoader loader, final String packageName); static ArrayList iterToList(Iterable it); static Object convertToArray(final Class type, final List<?> values); static Class<?> getClass(Type type); static List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass); static Class<?> getTypeArgument(Class<? extends T> clazz, TypeVariable<? extends GenericDeclaration> tv);  }