private void handleWhereBlock(Method method) {
    Block lastblock = method.getLastBlock();
    FilterBlock filterBlock;
    WhereBlock whereBlock;
    if (lastblock instanceof FilterBlock) {
      filterBlock = (FilterBlock) lastblock;
      whereBlock = (WhereBlock) lastblock.getPrevious();
    } else if (lastblock instanceof WhereBlock) {
      filterBlock = null;
      whereBlock = (WhereBlock) lastblock;
    } else {
      return;
    }

    DeepBlockRewriter deep = new DeepBlockRewriter(this);
    deep.visit(whereBlock);
    WhereBlockRewriter.rewrite(whereBlock, filterBlock, this, deep.isDeepNonGroupedConditionFound());
  }
A Spec visitor responsible for most of the rewriting of a Spec's AST.

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