code: Set<String> importedTypes(List<MessageType> msgTypes) {
          Set<String> imports = new TreeSet<>();
          msgTypes.forEach(t -> t.accept(importVisitor, imports));
          return imports;
      }
docs: Retrieve a list of types that need to be imported, so that the factory body can refer
  to the types in the given list using simple names.