scala/magnet-pattern: Example of using the magnet pattern