Scala triangle enumeration examples behave like their Java counterparts