code: public static LinkedHashSet<ClassNode> collectSelfTypes(
              ClassNode receiver,
              LinkedHashSet<ClassNode> selfTypes) {
          return collectSelfTypes(receiver, selfTypes, true, true);
      }
docs: Collects all the self types that a type should extend or implement, given
  the traits is implements. Collects from interfaces and superclasses too.
  @param receiver a class node that may implement a trait
  @param selfTypes a collection where the list of self types will be written
  @return the selfTypes collection itself
  @since 2.4.0