=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java 2014-08-15 07:40:20 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java 2014-09-25 12:50:57 +0000 @@ -80,6 +80,24 @@ } /** + * Retains only elements in the give list that are part of the given retain + * list. + * + * @param list the target list. + * @param retain the elements to retain in the target list. + */ + public static List retainAll( List list, List retain ) + { + if ( list == null || retain == null ) + { + return list; + } + + list.retainAll( retain ); + return list; + } + + /** * Returns a sublist of the given list with the elements at the given indexes. * * @param list the list to select from.