public static int maxFill(final int n,final float f){
  return Math.min((int)Math.ceil(n * f),n - 1);
}

public static int maxFill ( final int n , final float f ) { return Math . min ( ( int ) Math . ceil ( n * f ) , n - 1 ) ; }
returns the maximum number of entries that can be filled before rehashing .
