public static <E> E restrictedArgMax(Counter<E> c, Collection<E> restriction) {
    E maxKey = null;
    double max = Double.NEGATIVE_INFINITY;
    for (E key : restriction) {
      double count = c.getCount(key);
      if (count > max) {
        max = count;
        maxKey = key;
      }
    }
    return maxKey;
  }
public static < E > E restrictedArgMax ( Counter < E > c , Collection < E > restriction ) { E maxKey = null ; double max = Double . NEGATIVE_INFINITY ; for ( E key : restriction ) { double count = c . getCount ( key ) ; if ( count > max ) { max = count ; maxKey = key ; } } return maxKey ; }
@return Returns the maximum element of c that is within the restriction
Collection