public int incr(T k,int delta){
  Integer i=counts.get(k);
  if (i == null) {
    i=0;
  }
  int next=i.intValue() + delta;
  if (next < 0) {
    throw new java.lang.ArithmeticException();
  }
  if (next == 0) {
    counts.remove(k);
  }
 else {
    counts.put(k,i + delta);
  }
  return i;
}

public int incr ( T k , int delta ) { Integer i = counts . get ( k ) ; if ( i == null ) { i = 0 ; } int next = i . intValue ( ) + delta ; if ( next < 0 ) { throw new java . lang . ArithmeticException ( ) ; } if ( next == 0 ) { counts . remove ( k ) ; } else { counts . put ( k , i + delta ) ; } return i ; }
adds delta to the count for k and returns the count prior to addition .
