code: public static Set<Class<?>> getAllInterfaces(Class<?> cls) {
          if (cls == null) {
              return null;
          }
  
          // a LinkHashSet will mantain the order
          Set<Class<?>> interfacesFound = Sets.newLinkedHashSet();
          getAllInterfaces(cls, interfacesFound);
  
          return ImmutableSet.copyOf(interfacesFound);
      }
docs: <p>Gets a <code>Set</code> 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. Duplicates are ignored,
  so the order is maintained.</p>
  
  @param cls  the class to look up, may be <code>null</code>
  @return the <code>List</code> of interfaces in order,
  <code>null</code> if null input