title: How can I clone a Wicket Component, retaining it's configuration, but changing it's ID
body: <p>I've recently started working with Apache Wicket in a collaborative java project that has been using Wicket for a while. I currently have the following problem:</p>
  
  <p>I have a method where I receive a list of components and, due to some project requirements, I can't change their source generator.</p>
  
  <pre><code>private List&lt;Component&gt; createNewComponents(List&lt;Component&gt; components) {
  // create new list of components with different IDs and some other logic
  }
  </code></pre>
  
  <p>I need to clone each of the components I received to create a new set of components, but with different IDs. I know I can't change a component's ID and that's why I'm trying to clone or copy the component parameters in some way, although I have not yet been successful.</p>
  
  <p>Does anyone know if this is possible? And if so, what would be the best way to achieve this?</p>
  
  <p>Thank you very much for your time.</p>