code: public static ClosureExpression getClosure(BlockStatement block, String name,
  			boolean remove) {
  		for (ExpressionStatement statement : getExpressionStatements(block)) {
  			Expression expression = statement.getExpression();
  			if (expression instanceof MethodCallExpression) {
  				ClosureExpression closure = getClosure(name,
  						(MethodCallExpression) expression);
  				if (closure != null) {
  					if (remove) {
  						block.getStatements().remove(statement);
  					}
  					return closure;
  				}
  			}
  		}
  		return null;
  	}
docs: Extract a top-level {@code name} closure from inside this block if there is one,
  optionally removing it from the block at the same time.
  @param block a block statement (class definition)
  @param name the name to look for
  @param remove whether or not the extracted closure should be removed
  @return a beans Closure if one can be found, null otherwise