code: public List<Type> getAllInterfaces(Type type,
              Configuration configuration, boolean sort) {
          Map<ClassDoc,Type> results = sort ?
                  new TreeMap<ClassDoc,Type>() :
                  new LinkedHashMap<ClassDoc,Type>();
          Type[] interfaceTypes = null;
          Type superType = null;
          if (type instanceof ParameterizedType) {
              interfaceTypes = ((ParameterizedType) type).interfaceTypes();
              superType = ((ParameterizedType) type).superclassType();
          } else if (type instanceof ClassDoc) {
              interfaceTypes = ((ClassDoc) type).interfaceTypes();
              superType = ((ClassDoc) type).superclassType();
          } else {
              interfaceTypes = type.asClassDoc().interfaceTypes();
              superType = type.asClassDoc().superclassType();
          }
  
          for (Type interfaceType : interfaceTypes) {
              ClassDoc interfaceClassDoc = interfaceType.asClassDoc();
              if (!(interfaceClassDoc.isPublic() ||
                    (configuration == null ||
                     isLinkable(interfaceClassDoc, configuration)))) {
                  continue;
              }
              results.put(interfaceClassDoc, interfaceType);
              for (Type t : getAllInterfaces(interfaceType, configuration, sort)) {
                  results.put(t.asClassDoc(), t);
              }
          }
          if (superType == null)
              return new ArrayList<>(results.values());
          //Try walking the tree.
          addAllInterfaceTypes(results,
              superType,
              interfaceTypesOf(superType),
              false, configuration);
          List<Type> resultsList = new ArrayList<>(results.values());
          if (sort) {
                  Collections.sort(resultsList, new TypeComparator());
          }
          return resultsList;
      }
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  type       type whose implemented or
  super interfaces are sought.
  @param  configuration the current configuration of the doclet.
  @param  sort if true, return list of interfaces sorted alphabetically.
  @return List of all the required interfaces.