@Override
  public Iterator<Block> iterator() {
    return new Iterator<Block>() {
      Block block = first;

      @Override
      public boolean hasNext() {
        return block != null;
      }

      @Override
      public Block next() {
        if (hasNext()) {
          Block result = block;
          block = block.getNext();
          return result;
        } else
          throw new NoSuchElementException();
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("remove");
      }
    };
  }
AST node representing a Spec method (one of fixture method, feature method, helper method).

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/model/Method.java