Array.class_eval do

  # Returns a copy of the array that was grown or shrinked to the given size.
  #
  # @param expected_size: The size to grow/shrink to
  # @param fill_with: When growing, use this object. Defaults to nil.
  #
  def in_size(expected_size, fill_with = nil)
    sized = self[0, expected_size]
    sized << fill_with while sized.size < expected_size
    sized
  end

end
