code: public static Set<Class<?>> getAllInterfaces(final Class<?> cls) {
          final Set<Class<?>> interfacesFound = new LinkedHashSet<>();
  
          getAllInterfaces(cls, interfacesFound);
  
          return interfacesFound;
      }
docs: Copied from Apache Commons Lang under Apache License v2.
  
  <p>Gets a {@code List} of all interfaces implemented by the given
  class and its super classes.</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.
  @return the {@code List} of interfaces in order