private static SearchResultGroup extractGroupFor(ICompilationUnit cu,List<SearchResultGroup> searchResultGroups){
  for (Iterator<SearchResultGroup> iter=searchResultGroups.iterator(); iter.hasNext(); ) {
    SearchResultGroup group=iter.next();
    if (cu.equals(group.getCompilationUnit())) {
      iter.remove();
      return group;
    }
  }
  return null;
}

private static SearchResultGroup extractGroupFor ( ICompilationUnit cu , List < SearchResultGroup > searchResultGroups ) { for ( Iterator < SearchResultGroup > iter = searchResultGroups . iterator ( ) ; iter . hasNext ( ) ; ) { SearchResultGroup group = iter . next ( ) ; if ( cu . equals ( group . getCompilationUnit ( ) ) ) { iter . remove ( ) ; return group ; } } return null ; }
removes the found searchresultgroup from the list iff found .
