Refactored example to Option.collect method.

After refactoring:
```scala
// Returns Some(HTTP) because the partial function covers the case.
Some("http") collect {case "http" => "HTTP"}

// Returns None because the partial function doesn't cover the case.
Some("ftp") collect {case "http" => "HTTP"}

// Returns None because None is passed to the collect method.
None collect {case value => value}
```