private void getAllInterfaces(Set<ClassNode> res) {
    if (isInterface()) res.add(this);

    for (ClassNode anInterface : getInterfaces()) {
      res.add(anInterface);
      anInterface.getAllInterfaces(res);
    }
  }
  public void addTransform(Class<? extends ASTTransformation> transform, ASTNode node) {
    GroovyASTTransformation annotation = transform.getAnnotation(GroovyASTTransformation.class);
    if (annotation == null) return;

    Set<ASTNode> nodes = getTransformInstances().get(annotation.phase()).get(transform);
    if (nodes == null) {
      nodes = new LinkedHashSet<ASTNode>();
      getTransformInstances().get(annotation.phase()).put(transform, nodes);
    }
    nodes.add(node);
  }