private int max(Map<Integer, ModifiableDBIDs> candidates) {
    int maxDim = -1, size = -1;
    for(Integer nextDim : candidates.keySet()) {
      int nextSet = candidates.get(nextDim).size();
      if(size < nextSet) {
        size = nextSet;
        maxDim = nextDim;
      }
    }
    return maxDim;
  }
private int max ( Map < Integer , ModifiableDBIDs > candidates ) { int maxDim = - 1 , size = - 1 ; for ( Integer nextDim : candidates . keySet ( ) ) { int nextSet = candidates . get ( nextDim ) . size ( ) ; if ( size < nextSet ) { size = nextSet ; maxDim = nextDim ; } } return maxDim ; }
Returns the set with the maximum size contained in the specified map.

@param candidates the map containing the sets
@return the set with the maximum size