public static void mergeExtensionLists( Build childBuild, Build parentBuild ) { Map extMap = new LinkedHashMap(); List ext = childBuild.getExtensions(); if ( ext != null ) { for ( Iterator it = ext.iterator(); it.hasNext(); ) { Extension extension = (Extension) it.next(); extMap.put( extension.getKey(), extension ); } } ext = parentBuild.getExtensions(); if ( ext != null ) { for ( Iterator it = ext.iterator(); it.hasNext(); ) { Extension extension = (Extension) it.next(); if ( !extMap.containsKey( extension.getKey() ) ) { extMap.put( extension.getKey(), extension ); } } } childBuild.setExtensions( new ArrayList( extMap.values() ) ); }