public static List<Class<?>> getAllInterfaces(Class<?> cls) {
        if (cls == null) {
            return null;
        }

        LinkedHashSet<Class<?>> interfacesFound = new LinkedHashSet<Class<?>>();
        getAllInterfaces(cls, interfacesFound);

        return new ArrayList<Class<?>>(interfacesFound);
    }
<p>Gets a {@code List} of all interfaces implemented by the given
class and its superclasses.</p>

<p>The order is determined by looking through each interface in turn as
declared in the source file and following its hierarchy up. Then each
superclass is considered in the same way. Later duplicates are ignored,
so the order is maintained.</p>

@param cls  the class to look up, may be {@code null}
@return the {@code List} of interfaces in order,
 {@code null} if null input
android/android_framework/base/src/main/java/lang3/ClassUtils.java