package trabalhoPDS.catalogo; import java.util.Iterator; import java.util.List; public class DeepClone implements CloneStrategy { public List handleChildren(List list) { List newList = null; try { newList = list.getClass().newInstance(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } Iterator it = list.iterator(); while(it.hasNext()){ try { newList.add(it.next().cloneProduto()); } catch (CloneNotSupportedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return newList; } }