code: private ImmutableSet<JSType> getTypesToSkipForType(JSType type) {
      type = type.restrictByNotNullOrUndefined();
      if (type.isUnionType()) {
        ImmutableSet.Builder<JSType> types = ImmutableSet.builder();
        types.add(type);
        for (JSType alt : type.getUnionMembers()) {
          types.addAll(getTypesToSkipForTypeNonUnion(alt));
        }
        return types.build();
      } else if (type.isEnumElementType()) {
        return getTypesToSkipForType(type.getEnumeratedTypeOfEnumElement());
      }
      return ImmutableSet.copyOf(getTypesToSkipForTypeNonUnion(type));
    }
docs: Returns a set of types that should be skipped given the given type. This is
  necessary for interfaces, as all super interfaces must also be skipped.