code: public static TreeSet<Class<?>> getAllInterfaces(Class<?> cls) {
          final TreeSet<Class<?>> interfacesFound = new TreeSet<>(
              (c1, c2) -> {
                  if (c1.equals(c2)) {
                      return 0;
                  } else if (c1.isAssignableFrom(c2)) {
                      return 1;
                  } else {
                      return -1;
                  }
              }
          );
          getAllInterfaces(cls, interfacesFound);
          return interfacesFound;
      }
docs: Returns a set of all interfaces defined for {@code cls}.
  Interfaces are sorted from lowest to highest level (i.e. children before parents)