code: public Set<TypeMirror> getAllInterfaces(TypeElement te) {
          Set<TypeMirror> results = new LinkedHashSet<>();
  
          List<? extends TypeMirror> interfaceTypes = te.getInterfaces();
  
          for (TypeMirror interfaceType : interfaceTypes) {
              TypeElement intfc = asTypeElement(interfaceType);
  
              if (isPublic(intfc) || isLinkable(intfc)) {
                  results.add(interfaceType);
                  TypeElement klass = asTypeElement(interfaceType);
                  for (TypeMirror t : getAllInterfaces(klass)) {
                      t = getDeclaredType(results, te, t);
                      results.add(t);
                  }
              }
          }
          // TypeMirror contains the modified TypeParameterElement's types represented
          // in the local Class'es elements types. ex: Foo<E> implements Bar<V> and the
          // class being considered is Foo then TypeParameters will be represented as <E>
          // note that any conversion might revert back to the old signature. For this
          // very reason we get the superType, and find its interfaces.
          TypeMirror superType = getSuperType(te);
          if (superType == getObjectType())
              return results;
          // Try walking the tree
          addAllInterfaceTypes(results, te, superType,
                  configuration.workArounds.interfaceTypesOf(superType));
          return results;
      }
docs: For the class return all implemented interfaces including the
  superinterfaces of the implementing interfaces, also iterate over for
  all the superclasses. For interface return all the extended interfaces
  as well as superinterfaces for those extended interfaces.
  
  @param  te the class to get the interfaces for
  @return List of all the required interfaces.