class Array

def uniq_with_block!

def uniq_with_block!
  replace self if frozen? # force error
  return uniq_without_block! unless block_given?
  u = uniq{|e| yield e}
  replace u unless u.size == size
end