public static List cloneLicenses( List licenses ) { if ( licenses == null ) { return null; } List ret = new ArrayList(); Iterator it = licenses.iterator(); while ( it.hasNext() ) { License license = (License) it.next(); License cloned = new License(); cloned.setId( license.getId() ); cloned.setName( license.getName() ); cloned.setUrl( license.getUrl() ); cloned.setComments( license.getComments() ); ret.add( cloned ); } return ret; }