code: public boolean trim(final int n) {
          final int l = HashCommon.nextPowerOfTwo((int) Math.ceil(n / f));
          if (l >= n || size > maxFill(l, f)) return true;
          try {
              rehash(l);
          } catch (Error cantDoIt) {
              return false;
          }
          return true;
      }
docs: Rehashes this map if the table is too large.
  <br>Let <var>N</var> be the smallest table size that can hold <code>max(n,{@link #size()})</code> entries, still satisfying the load factor. If the current table size is smaller than or equal to
  <var>N</var>, this method does nothing. Otherwise, it rehashes this map in a table of size <var>N</var>.
  <br>This method is useful when reusing maps. {@linkplain #clear() Clearing a map} leaves the table size untouched. If you are reusing a map many times, you can call this method with a typical
  size to avoid keeping around a very large table just because of a few large transient maps.
  
  @param n the threshold for the trimming.
  @return true if there was enough memory to trim the map.
  @see #trim()