public Collection<? extends Element> generateMultiple(Element parent,ElementMetadata<?,?> parentMetadata,ElementMetadata<?,?> metadata){
  Preconditions.checkState(path.selectsElement(),"An attribute path cannot be used to generate elements.");
  Collection<? extends Element> elements=getFinalElements(path,parent);
  if (elements.isEmpty()) {
    return elements;
  }
  List<Element> result=Lists.newArrayListWithCapacity(elements.size());
  for (  Element e : elements) {
    try {
      ElementKey<?,?> realKey=mergeKeys(e.getElementKey(),metadata.getKey());
      result.add(Element.createElement(realKey,e));
    }
 catch (    ContentCreationException ex) {
      throw new IllegalArgumentException("Invalid metadata",ex);
    }
  }
  return result;
}

public Collection < ? extends Element > generateMultiple ( Element parent , ElementMetadata < ? , ? > parentMetadata , ElementMetadata < ? , ? > metadata ) { Preconditions . checkState ( path . selectsElement ( ) , "An attribute path cannot be used to generate elements." ) ; Collection < ? extends Element > elements = getFinalElements ( path , parent ) ; if ( elements . isEmpty ( ) ) { return elements ; } List < Element > result = Lists . newArrayListWithCapacity ( elements . size ( ) ) ; for ( Element e : elements ) { try { ElementKey < ? , ? > realKey = mergeKeys ( e . getElementKey ( ) , metadata . getKey ( ) ) ; result . add ( Element . createElement ( realKey , e ) ) ; } catch ( ContentCreationException ex ) { throw new IllegalArgumentException ( "Invalid metadata" , ex ) ; } } return result ; }
generate multiple elements based on this path . this only allows a single multiple cardinality element in the path , but that multiple cardinality element can be anywhere in the path . once found we only follow single cardinality children after that point . cardinality along the path .
