code: public boolean shrink(int maxCapacity) {
          if (maxCapacity >= array.length) {
              return false;
          }
  
          array = Arrays.copyOf(array, maxCapacity);
          return true;
      }
docs: Shrinks the storage to the specified maximum capacity.
  <p>
  If the current capacity is less or equal to the specified capacity, nothing happens.
  
  @param maxCapacity
  the maximal number of elements the storage array has to provide room for.
  
  @return <code>true</code> iff the storage array had to be resized, <code>false</code> otherwise.