code: public ExecutionVertex duplicateVertex(final boolean preserveVertexID) {
  
  		ExecutionVertexID newVertexID;
  		if (preserveVertexID) {
  			newVertexID = this.vertexID;
  		} else {
  			newVertexID = new ExecutionVertexID();
  		}
  
  		final ExecutionVertex duplicatedVertex = new ExecutionVertex(newVertexID, this.executionGraph,
  			this.groupVertex, this.outputGates.length, this.inputGates.length);
  
  		// Duplicate gates
  		for (int i = 0; i < this.outputGates.length; ++i) {
  			duplicatedVertex.outputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex,
  				this.outputGates[i].getGroupEdge(), false);
  		}
  
  		for (int i = 0; i < this.inputGates.length; ++i) {
  			duplicatedVertex.inputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex,
  				this.inputGates[i].getGroupEdge(), true);
  		}
  
  		// TODO set new profiling record with new vertex id
  		duplicatedVertex.setAllocatedResource(this.allocatedResource.get());
  
  		return duplicatedVertex;
  	}
docs: Returns a duplicate of this execution vertex.
  
  @param preserveVertexID
  <code>true</code> to copy the vertex's ID to the duplicated vertex, <code>false</code> to create a new ID
  @return a duplicate of this execution vertex