code: private static int actualArrayLength(int recommended) {
      if (recommended > MAX_ARRAY_LENGTH) {
        return MAX_ARRAY_LENGTH;
      } else if (recommended < MIN_ARRAY_LENGTH) {
        return MIN_ARRAY_LENGTH;
      } else {
        final int a = Integer.highestOneBit(recommended);
        return a == recommended? a: a << 1;
      }
    }
docs: compute actual length