@solnic in this example, the `@extensions` inside the begin block isn't necessary. It will never get executed due to the `@extensions ||=` part. Also `Array#concat` is a more efficient way to append another Array onto an existing Array.

However, there's a nicer way to check if a method is defined in the superclass, if there is one:

```ruby
def extensions
  @extensions ||= defined?(super) ? super.dup : Set.new
end
```

Although given that this is coming from the superclass, what I would probably do is define an `#inherited` hook that explicitly sets `@extensions`. Then this method block simply becomes `@extensions ||= Set.new`, which will be used in base classes.