Scala Direction enum with Enumeration and collection usage
Use an Algebraic Data Type (ADT):

abstract class Direction(val opposite: Direction)
case object Up extends Direction(Down)
case object Down extends Direction(Up)
case object Left extends Direction(Right)
case object Right extends Direction(Left)


or:

abstract class Direction {
  def isOpposite(d: Direction): Boolean
}
case object Up extends Direction {
  def isOpposite(d: Direction) = d == Down
}
case object Down extends Direction {
  def isOpposite(d: Direction) = d == Up
}
case object Left extends Direction {
  def isOpposite(d: Direction) = d == Right
}
case object Right extends Direction {
  def isOpposite(d: Direction) = d == Left
}