code: private NamedOutputBlockContext findAndRemoveBlock(List<NamedOutputBlockContext> blocks, String name) {
  
      if(blocks == null) {
        return null;
      }
  
      Iterator<NamedOutputBlockContext> blockIter = blocks.iterator();
      while (blockIter.hasNext()) {
        NamedOutputBlockContext block = blockIter.next();
        String blockName = name(block);
        if(name.equals(blockName)) {
          blockIter.remove();
          return block;
        }
      }
  
      return null;
    }
docs: Find and remove block with specific name
  
  @param blocks List of ParamOutputBlocks to search
  @param name Name of block to find
  @return ParamOutputBlock with specified name