ReflectionUtils { static PropertyDescriptor[] getInterfacePropertyDescriptors(Class<?> interfaceClass) { List<PropertyDescriptor> propDescriptors = new ArrayList<>(); propDescriptors.addAll(Arrays.asList(PropertyUtils.getPropertyDescriptors(interfaceClass))); Class<?>[] interfaces = interfaceClass.getInterfaces(); if (interfaces != null) { for (Class<?> superInterfaceClass : interfaces) { List<PropertyDescriptor> superInterfacePropertyDescriptors = Arrays .asList(getInterfacePropertyDescriptors(superInterfaceClass)); for (PropertyDescriptor superPropDescriptor : superInterfacePropertyDescriptors) { PropertyDescriptor existingPropDescriptor = findPropDescriptorByName(propDescriptors, superPropDescriptor.getName()); if (existingPropDescriptor == null) { propDescriptors.add(superPropDescriptor); } else { try { if (existingPropDescriptor.getReadMethod() == null) { existingPropDescriptor.setReadMethod(superPropDescriptor.getReadMethod()); } if (existingPropDescriptor.getWriteMethod() == null) { existingPropDescriptor.setWriteMethod(superPropDescriptor.getWriteMethod()); } } catch (IntrospectionException e) { throw new MappingException(e); } } } } } return propDescriptors.toArray(new PropertyDescriptor[propDescriptors.size()]); } private  ReflectionUtils(); static PropertyDescriptor findPropertyDescriptor(Class<?> objectClass, String fieldName,
                                                            HintContainer deepIndexHintContainer); static DeepHierarchyElement[] getDeepFieldHierarchy(Class<?> parentClass, String field,
                                                               HintContainer deepIndexHintContainer); static Method getMethod(Object obj, String methodName); static Method getMethod(Class<?> clazz, String methodName); static Method findAMethod(Class<?> clazz, String methodName, BeanContainer beanContainer); static PropertyDescriptor[] getPropertyDescriptors(Class<?> objectClass); static Field getFieldFromBean(Class<?> clazz, String fieldName); static Object invoke(Method method, Object obj, Object[] args); static Method getMethod(Class<?> clazz, String name, Class<?>[] parameterTypes); static T newInstance(Class<T> clazz); static Class<?> determineGenericsType(Class<?> parentClazz, PropertyDescriptor propDescriptor); static Class<?> determineGenericsType(Class<?> clazz, Method method, boolean isReadMethod); static Class<?> determineGenericsType(Type type); static Method getNonStandardSetter(Class<?> clazz, String fieldName);  }
@Test public void testGetInterfacePropertyDescriptors() { PropertyDescriptor[] descriptors = ReflectionUtils.getInterfacePropertyDescriptors(TestIF1.class); assertEquals(1, descriptors.length); descriptors = ReflectionUtils.getInterfacePropertyDescriptors(TestIF2.class); assertEquals(1, descriptors.length); descriptors = ReflectionUtils.getInterfacePropertyDescriptors(TestClass.class); assertEquals(3, descriptors.length); }